2
votes

I have Mathematica expressions involving the special functions Erf[x] and Erfc[x], but I'd like to express them in terms of the scaled and translated version

F[x_] := CDF[NormalDistribution[0,1]][x]

throughout the notebook. This is because F[x] has an easy interpretation in the context of my problem.

1
Please give an extended explanation of the behavior you desire, and at least a small sample of your code.Mr.Wizard
Link to the same question on MathGroup: groups.google.com/d/topic/comp.soft-sys.math.mathematica/…Szabolcs

1 Answers

3
votes

Not sure whether I understand your problem, but I'm trying to answer my interpretation of what your saying.

So you have an expression in erf and erfc, like this

expr = Erf[x] + 1/Erfc[x] + Sin[Erf[x]] + Cos[Erfc[x]] 

All it takes to replace erf and erfc with F is this:

 expr //. {Erfc[x_] -> 2 F[-(x) Sqrt[2]], Erf[x_] -> 1 - Erfc[x]}

 (* ==>  1 + Cos[2 F[-Sqrt[2] x]] + 1/(2 F[-Sqrt[2] x]) -
         2 F[-Sqrt[2] x] + Sin[1 - 2 F[-Sqrt[2] x]]
 *)

which with your definition of F[x] is indeed the same:

1 + Cos[2 F[-Sqrt[2] x]] + 1/(2 F[-Sqrt[2] x]) - 2 F[-Sqrt[2] x] + 
  Sin[1 - 2 F[-Sqrt[2] x]] /. F[x_] -> CDF[NormalDistribution[0, 1]][x]

(* ==> 1 + Cos[Erfc[x]] + 1/Erfc[x] - Erfc[x] + Sin[1 - Erfc[x]] *)