1
$\begingroup$

I am trying to find a solution to calculate relationship between an amplitude and boundaries of a Gaussian function so that an area under the curve is constant, let's say 2.

I found a solution via integration to calculate area under a Gaussian function $e^{-Ax^2}$, which happens to be of a $\mathrm{erf}$ function form: $\frac{1}{\sqrt{A}}\, \frac{\sqrt{\pi}}{2}\mathrm{erf}(\sqrt{A}x)$. I found that setting boundaries to $x=-2.76$ and $x=2.76$ make the area equal to 1.9998. I would like to be able to change the parameter $A$ and make this to be related to boundaries such that the area stays 1.9998. Because $A$ is inside erf and I don't know anything about erf I cannot figure out if this is possible. I hope someone can help.

Any clue is very appreciated :)

$\endgroup$
  • $\begingroup$ What value of $ A $ did you use to get those bounds of $ x $? $\endgroup$ – Jon Claus Feb 10 '14 at 21:25
  • $\begingroup$ I assumed $A=1$. I calculated it in MATLAB using the erf() command, such as area = erf(2.76) - erf(-2.76) $\endgroup$ – Celdor Feb 11 '14 at 9:40
1
$\begingroup$

It seems that you are interested in the function $A\mapsto x(A)$ defined by the identity $$ \int_{-x(A)}^{x(A)}\mathrm e^{-At^2}\mathrm dt=2. $$ Then, as you observed, $x(A)$ is defined implicitly by the identity $$ \sqrt\pi\cdot\mathrm{erf}(x(A)\sqrt{A})=2\sqrt{A}. $$ Thus, $x$ is defined on $[0,\pi/4)$ and increasing from $x(0)=1$ to $\lim\limits_{A\to(\pi/4)^-}x(A)=+\infty$. In particular, $x(A)$ does not exist when $A\gt\pi/4\approx0.785$.

$\endgroup$
  • $\begingroup$ Sorry Did I did not follow this. I don't know what you mean by x(A) and A -> pi/4. Does it mean A cannot be 1? $\endgroup$ – Celdor Feb 10 '14 at 11:17
  • $\begingroup$ x(A) is defined in the answer. A ->pi/4 means that one considers the limit when A approches pi/4. Yes A cannot be 1. $\endgroup$ – Did Feb 10 '14 at 11:20
  • $\begingroup$ I find it difficult to understand why A cannot be greater than $\pi{}/4$. I don't really follow this approach, similarly to where [0,pi/4) boundary comes from. $\endgroup$ – Celdor Feb 10 '14 at 13:06
  • $\begingroup$ The total area under the curve $t\mapsto\mathrm e^{-At^2}$ being $\sqrt{\pi/A}$, one cannot ask that a part of this area has measure $2$ if $\sqrt{\pi/A}\lt2$. This forbidden range of the parameter $A$ translates into $A\gt\pi/4$. $\endgroup$ – Did Feb 10 '14 at 16:11
  • $\begingroup$ Thanks for your effort. I understand it now. Somehow I could not spot this bit before. $\endgroup$ – Celdor Feb 12 '14 at 8:52
0
$\begingroup$

If I properly understand, you want that the integral between $-a$ and $+a$ be a constant, say $Area$. As you noticed by yourself, this leads to the equation the value of the integral is $$Area=\frac{\sqrt{\pi } \text{erf}\left(a \sqrt{A}\right)}{\sqrt{A}}$$ This gives you an equation which relates all your parameters. You can notice from this equation that $$\frac{\text{Area}}{a}=\frac{\sqrt{\pi } \text{erf}\left(a \sqrt{A}\right)}{a \sqrt{A}}$$

Working numerically the inverse of the $\text{erf}$ function is not the easiest thing but it is doable.

If you need more, just post please.

$\endgroup$
  • $\begingroup$ Thanks Claude. I've read $\mathrm{erf}^{-1}\left(\mathrm{erf}(x)\right)=x$. Following this, $\frac{\mathrm{Area}}{a}\frac{a\sqrt{A}}{\sqrt{\pi}}=\mathrm{erf}\left(a\sqrt{A}\right)$, and then $\mathrm{erf}^{-1}\left(\mathrm{Area}\sqrt{\frac{A}{\pi}}\right)=a\sqrt{A}$. Finally $\frac{1}{\sqrt{A}}\, \mathrm{erf}^{-1}\left(\mathrm{Area}\sqrt{\frac{A}{\pi}}\right)=a$. Do you think I have rearranged this equatiojn correctly? Can this work? $\endgroup$ – Celdor Feb 10 '14 at 12:59

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.