4

I'd like to solve the following equation for $S$, in terms of $p, x,$ and $\sigma$:

$$ p = \int_0^x\sqrt{\frac{2}{\pi}} \frac{e^{\frac{-(S-\mu)^2}{2\sigma^2}}}{\mathrm{erf}\left(\frac{S}{\sqrt{2}\sigma}\right)- \mathrm{erf}\left(\frac{S-1}{\sqrt{2}\sigma}\right)} d\mu $$

Solving the integral as Mhenni suggested yields: $$ p = \frac{\frac{\sqrt{2}}{2}\left(\mathrm{erf}\left(\frac{S-x}{\sqrt{2}\sigma}\right) - \mathrm{erf}\left(\frac{S}{\sqrt{2}\sigma}\right) \right)}{{\mathrm{erf}\left(\frac{S}{\sqrt{2}\sigma}\right)- \mathrm{erf}\left(\frac{S-1}{\sqrt{2}\sigma}\right)}} $$

The problem now is dealing with the $S$'s inside the error functions. I know there's an inverse error function ($\mathrm{erf}^{-1}$), but I don't see how this is ultimately solvable for $S$.

Is this possible?

Thanks for any help!

sundance
  • 141
  • Make change of variables $(S-\mu) /(\sqrt{2}\sigma) =t$ and then use the erf function. – Mhenni Benghorbal Mar 04 '16 at 04:23
  • So then I would be integrating with respect to $t$, since $t$ would contain $\mu$? – sundance Mar 04 '16 at 04:36
  • You will be integrating with respect to $t$! It is just a change of variables! Do you know how make integration but substitution? – Mhenni Benghorbal Mar 04 '16 at 04:38
  • It's been a while but yes. But I'm not sure how to integrate the error function. – sundance Mar 04 '16 at 04:43
  • What are you doing? The denominator does not depend on $\mu$? Also you need to change the limits of integration too! By the way where did this problem come from? – Mhenni Benghorbal Mar 04 '16 at 04:43
  • Sorry, my mistake, removed that edit. This makes a lot more sense now, and I can just pull the error functions out of the integral. Thanks! Solving for S will still depend on using the inverse error function after dealing with the integral, so I'm still not sure if this is possible. – sundance Mar 04 '16 at 04:59

2 Answers2

3

I suppose that there are some typo's.

The result I obtained is $$p=\sigma\frac{ \text{erf}\left(\frac{S}{\sqrt{2} \sigma }\right)-\text{erf}\left(\frac{S-x}{\sqrt{2} \sigma }\right)}{\text{erf}\left(\frac{S}{\sqrt{2} \sigma }\right)-\text{erf}\left(\frac{S-1}{\sqrt{2} \sigma }\right)}$$ I do not think that you could be able to solve analytically the equation for $S$. More than likely, only numerical methods could do it.

If you provide some typical values for $p,\sigma,x$, I could look at some numerical scheme.

  • Thanks for your help! The constraints are $0 \leq p \leq 1$, $0 < \sigma \leq 1$, $0 \leq x \leq 1$, not sure if that helps. – sundance Mar 04 '16 at 05:45
  • You are welcome ! Again, I cannot imagine any anlytical solution. If you want, give me one value for each of the three parameters. – Claude Leibovici Mar 04 '16 at 05:47
-4

You have not changed to limits of integration

$$ p = \frac{ \sqrt{\frac{2}{\pi}} }{ {\mathrm{erf}\left(\frac{S}{\sqrt{2}\sigma}\right)- \mathrm{erf}\left(\frac{S-1}{\sqrt{2}\sigma}\right)}} \int_{S/(\sqrt{2}{\sigma}) }^{ (S-x) /(\sqrt{2}{\sigma}) } e^{-t^2} dt. $$

Added: You need my answer to finish evaluating the integral.