Ask Your Question

solve equation of erf

asked 2013-12-26 17:53:08 -0600

bukzor gravatar image

updated 2013-12-29 17:29:04 -0600

I used @ndomes' method of using numeric functions, but I still wind up unable to prove that erf... == erf...:

sage: var('x sigma mu')
sage: assume(sigma > 0)
sage: eq3 = (-erf((sqrt(2)*mu - sqrt(2)*x)/(2*sigma)) == -erf((sqrt(2)*(mu - x))/(2*sigma)))
sage: show(eq3)
sage: show(bool(eq3))

$\newcommand{\Bold}[1]{\mathbf{#1}}-\text{erf}\left(\frac{\sqrt{2} \mu - \sqrt{2} x}{2 \, \sigma}\right) = -\text{erf}\left(\frac{\sqrt{2} {\left(\mu - x\right)}}{2 \, \sigma}\right)$


This slightly simpler equation works correctly however:

sage: eq4 = (-erf((sqrt(2)*mu - sqrt(2)*x)/(sigma)) == -erf((sqrt(2)*(mu - x))/(sigma)))
sage: show(eq4)
sage: show(bool(eq4))

$-\text{erf}\left(\frac{\sqrt{2} \mu - \sqrt{2} x}{\sigma}\right) = -\text{erf}\left(\frac{\sqrt{2} {\left(\mu - x\right)}}{\sigma}\right)$


What's going on here?? Is it related to being unable to reduce inverse_erf(erf()) below?

sage: solve(erf(x) == erf(y), x)[0].simplify_full()
x == inverse_erf(erf(y))
edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted

answered 2013-12-26 21:17:28 -0600

ndomes gravatar image

updated 2013-12-26 22:19:36 -0600

I use a python function returning a numerical solution:

f(t) = (1/sqrt(2*pi))*e^(-t^2/2)

F(x) = integral(f,t,-oo,x)

def F_inverse(p):
    return find_root(F(x) == p, -10, 10)

To let Sage prove that both solutions are the same use bool

eqn = (erf(-(sqrt(2)*mu-sqrt(2)*t)/(2*sigma)) == erf(-(sqrt(2)*mu)/(2*sigma)+(sqrt(2)*t)/(2*sigma)))
eqn; bool(eqn)
edit flag offensive delete link more


Thanks, that helped, some. Could you take a look at my updated question? I'm still having issues.

bukzor gravatar imagebukzor ( 2013-12-28 06:00:43 -0600 )edit

answered 2013-12-28 16:04:29 -0600

kcrisman gravatar image

See Trac 11349 - this is probably only in Maxima. You may find this ask.sagemath question helpful, though not symbolically - it has some mpmath hints.

edit flag offensive delete link more


I don't know enough about how this works; will fixing the sage enhancement allow this expression to be simplified, considering that Maxima won't simplify it?

bukzor gravatar imagebukzor ( 2013-12-28 21:44:17 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2013-12-26 17:53:08 -0600

Seen: 274 times

Last updated: Dec 29 '13