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!

  • $\begingroup$ Make change of variables $(S-\mu) /(\sqrt{2}\sigma) =t$ and then use the erf function. $\endgroup$ – Mhenni Benghorbal Mar 4 '16 at 4:23
  • $\begingroup$ So then I would be integrating with respect to $t$, since $t$ would contain $\mu$? $\endgroup$ – sundance Mar 4 '16 at 4:36
  • $\begingroup$ You will be integrating with respect to $t$! It is just a change of variables! Do you know how make integration but substitution? $\endgroup$ – Mhenni Benghorbal Mar 4 '16 at 4:38
  • $\begingroup$ It's been a while but yes. But I'm not sure how to integrate the error function. $\endgroup$ – sundance Mar 4 '16 at 4:43
  • $\begingroup$ 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? $\endgroup$ – Mhenni Benghorbal Mar 4 '16 at 4:43

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.

  • $\begingroup$ 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. $\endgroup$ – sundance Mar 4 '16 at 5:45
  • $\begingroup$ You are welcome ! Again, I cannot imagine any anlytical solution. If you want, give me one value for each of the three parameters. $\endgroup$ – Claude Leibovici Mar 4 '16 at 5:47

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.

  • $\begingroup$ Right, sorry, fixed that I think. This should be $dt$, right? I'm imagining though that once I solve the integral I still may not be able to solve the equation for $S$. $\endgroup$ – sundance Mar 4 '16 at 5:16
  • $\begingroup$ Can you find the inverse of the erf function? $\endgroup$ – Mhenni Benghorbal Mar 4 '16 at 5:19
  • $\begingroup$ Yes, such a function exists $\endgroup$ – sundance Mar 4 '16 at 5:21
  • 3
    $\begingroup$ "You need my answer to finish evaluating the integral." Well, no, simply the definition of the erf function. $\endgroup$ – Did Mar 4 '16 at 7:11
  • 7
    $\begingroup$ Is this lack of "time to waste" the reason why you post wrong and/or misleading answers on the site? I am not following. $\endgroup$ – Did Mar 4 '16 at 7:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.