1
$\begingroup$

Edited out incorrect formula
Can someone please solve this equation for x? I have no idea what to do with the $\mathrm{erf}$ (error function).

Edit: Hm, it did not work correctly... here is the function I meant to solve for x in symbolic form:

$f(x) = a*\left(0.5*\mathrm{erf}\left(\frac{x-b}{c\sqrt{2}}+.5\right)\right)+d$

Coefficients (with 99% confidence bounds):        a =       1.412  (1.411, 1.412)        b =       1.259  (1.259, 1.259)        c =       1.003  (1.002, 1.003)        d =      0.3016  (0.3014, 0.3017) 

When I solve for f(x) with x=1 I get ans = 0.5460

I want to plug 0.5460 into a formula and get 1 back.
Chris, this is the Finv function you spoke of in my other question.

  • 0
    @9$3$25: ...suffice it to s$a$y that not all MATLAB installations have the Symbolic Toolbox han$d$y.2011-05-12

2 Answers 2

1

Let's start with the "general form" you say you had:

$a\left(\frac12\mathrm{erf}\left(\frac{x-b}{c\sqrt{2}}+\frac12\right)\right)+d=y$

and go over the inversion slo-o-owly...

$a\left(\frac12\mathrm{erf}\left(\frac{x-b}{c\sqrt{2}}+\frac12\right)\right)=y-d$

$\frac12\mathrm{erf}\left(\frac{x-b}{c\sqrt{2}}+\frac12\right)=\frac{y-d}{a}$

$\mathrm{erf}\left(\frac{x-b}{c\sqrt{2}}+\frac12\right)=2\frac{y-d}{a}$

Now, we can employ the inverse error function:

$\frac{x-b}{c\sqrt{2}}+\frac12=\mathrm{erf}^{-1}\left(2\frac{y-d}{a}\right)$

$\frac{x-b}{c\sqrt{2}}=\mathrm{erf}^{-1}\left(2\frac{y-d}{a}\right)-\frac12$

$x-b=c\sqrt{2}\left(\mathrm{erf}^{-1}\left(2\frac{y-d}{a}\right)-\frac12\right)$

$x=b+c\sqrt{2}\left(\mathrm{erf}^{-1}\left(2\frac{y-d}{a}\right)-\frac12\right)$

and that's the inverse you need.

Now, if it were

$a\left(\frac12\mathrm{erf}\left(\frac{x-b}{c\sqrt{2}}\right)+\frac12\right)+d=y$

instead (which I think is more likely, since you're starting from the normal distribution CDF), things are a bit different. What you should end up with is

$x=b+c\sqrt{2}\,\mathrm{erf}^{-1}\left(2\frac{y-d}{a}-1\right)$

which is probably the expression you actually need for those confidence intervals...

  • 0
    M Thanks for the extremely thorough explanation! The data is actually (apparently) closest to a half-normal distribution, but flattened at its max.2011-05-12
1

$x = 1.003\sqrt{2}\left(\mathrm{erf}^{-1}\left(\frac{Y/1.42 + 0.4042}{0.5}\right) - 0.05\right) + 0.5501$

  • 0
    @ Chris Hmm, it didn't work. Perhaps I wrote it incorrectly. Here it is in symbolic form: a*(0.5*erf((1-b)/(c*sqrt(2))+.5))+d2011-05-11