B Exponential decay convolved with Gaussian

AI Thread Summary
The discussion revolves around fitting data to a reversed exponentially modified Gaussian (EMG) function. The user initially encountered discrepancies in the heights of two EMG curves, which were resolved by changing the sign of the time constant 'd' from positive to negative. After this adjustment, both curves exhibited the same height, but the user questioned why the height was 0.9 instead of the expected value of 2. Other participants suggested that the maximum value of the EMG function should be calculated analytically to confirm the height, noting that the area under the curve relates to the parameters used. The conversation emphasizes the importance of understanding the mathematical properties of the EMG function for accurate modeling.
Rajini
Messages
619
Reaction score
4
Hello all,
I have a data which look like reversed exponentially modified Gaussian (EMG) function and interested to fit the data with with reversed EMG function. After searching on internet I found the EMG function, which is given below:
##y=\frac{ac\sqrt{2\pi}}{2d}\rm{exp}[\frac{c^2}{2d^2}-\frac{x-b}{d}][\frac{d}{|d|}+\rm{erf}(\frac{x-b}{c\sqrt2}-\frac{c}{d\sqrt2})]##
gnuplot code
PHP:
f(x)=(((a*c*sqrt(2*pi))/(2*d))*exp(((c*c)/(2*d*d))-((x-b)/d))*((d/(abs(d)))+erf(((x-b)/(c*sqrt(2)))-(c/(d*sqrt(2))))))
Here a=Gaussian height, b=Gaussian position, c=Gaussian width, d=time constant.
When I plot the above function in gnuplot I get a curve shown in fig1.
Now I reversed the EMG so the function becomes as below (just changed the signs):
##y=\frac{ac\sqrt{2\pi}}{2d}\rm{exp}[\frac{c^2}{2d^2}+\frac{x-b}{d}][\frac{d}{|d|}-\rm{erf}(\frac{x-b}{c\sqrt2}-\frac{c}{d\sqrt2})]## and the curve is shown in fig2.
gnuplot code
PHP:
f(x)=(((a*c*sqrt(2*pi))/(2*d))*exp(((c*c)/(2*d*d))+((x-b)/d))*((d/(abs(d)))-erf(((x-b)/(c*sqrt(2)))-(c/(d*sqrt(2))))))
For the above two EMGs I used a=2, b=30, c=1, and d=3.
1. My doubt is why both curves has different height (height a)? or I did anything wrong? Is 'a' really height?
2. I took 'a' as 2. But the height is 0.9 for EMG (fig1) and 1.13 for reversed EMG (in fig2).
Any insights will be helpful.
Thanks for your reply
Cheers,
Rajini
 

Attachments

  • fig1.png
    fig1.png
    8.1 KB · Views: 678
  • fig2.png
    fig2.png
    9.3 KB · Views: 678
Physics news on Phys.org
The exponential and erf functions in your formula have different local origin (e.g. the local origin of the exponential one is ##x=b##). From the way you revert the sign, you are mirroring each functions independently with respect to their own local origin. That's why the mirrored EMG has different height.
 
Hi blue leaf:
Thanks for your reply.
I just understand that to get a reversed EMG, I need to change the sign of 'd'.
So i took d as -3 and got the correct reversed EMG.
So now both (one with d as 3, and other as -3) EMGs has same height of 0.9.
But I am confused why 0.9 instead of 2?
Regards, Rajini
 
Last edited:
Rajini said:
Hi blue leaf:
Thanks for your reply.
I just understand that to get a reversed EMG, I need to change the sign of 'd'.
So i took d as -3 and got the correct reversed EMG.
So now both (one with d as 3, and other as -3) EMGs has same height of 0.9.
But I am confused why 0.9 instead of 2?
Regards, Rajini
It will be a good exercise to obtain the expression for the max value of this EMG function by calculating its stationary point. From there you should be able to confirm whether the height should indeed be equal to ##a## or not. By the way, using the values of the parameters as you use I got a max value very close to 1.0.
 
Hi blue leaf:
I think in the usual exponentially modified Gaussian (EMG) function
##y=\frac{ac\sqrt{2\pi}}{2d}\rm{exp}[\frac{c^2}{2d^2}-\frac{x-b}{d}][\frac{d}{|d|}+\rm{erf}(\frac{x-b}{c\sqrt2}-\frac{c}{d\sqrt2})]##
##ac\sqrt{2\pi}## represents area under the EMG function.
For reversed EMG one have to use negative time, i.e. ##d=-3## instead of ##d=3##.
I checked with Origin, which gives a area value of closer to ##ac\sqrt{2\pi}##.
Cheers, Raj
 
Rajini said:
I checked with Origin, which gives a area value of closer to ac√2πac\sqrt{2\pi}.
In order to be sure, why not really try integrating the EMG over all space? With the help of integration by part and the first derivative of error function I think you should be able to do the integral analytically.
 
Back
Top