The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum
 Origin Forum
 How to fit a custom function
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

kaghdami

Canada
4 Posts

Posted - 05/10/2020 :  08:26:55 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin): OriginPro 2020b (64-bit) 9.7.5.184

Operating System:win10
Hi
I need to fit data to two Gaussian function which subtracted each other as I sent by image. The function should be like:
y=y0 + A1/(w1*sqrt(pi/(4*log(2)))) * exp(-4*log(2)*(x-xc1).^2/w1^2) - A2/(w2*sqrt(pi/(4*log(2)))) * exp(-4*log(2)*(x-xc2).^2/w2^2)

I define all parameters, But I could not manage to have a converge Fit.
Please kindly help me for this
Regards,
Keivan



cc261

22 Posts

Posted - 05/10/2020 :  10:39:06 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi, please refer to the result below, which just based on some (not all) data extracted from your chart:

Root of Mean Square Error (RMSE): 0.00583565773177599
Sum of Squared Residual: 0.00255411758718276
Correlation Coef. (R): 0.993496887597805
R-Square: 0.987036065666525
Adjusted R-Square: 0.986675956379484

Parameter Best Estimate
---------- -------------
xc1 1551.48125439812
xc2 1552.42270091388
y0 -0.0122568156078516
a1 -0.117185964801416
w1 -0.385100852916404
a2 0.0742883583748268
w2 -0.427476518785693
Go to Top of Page

kaghdami

Canada
4 Posts

Posted - 05/18/2020 :  4:36:44 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi
Thank you for fitting the data with superposition of 2 Gaussian curve.
But the problem is, according to my theory the data should be a subtraction of a small Gaussian from the envelop big Gaussian curve like I demonstrate in the fig below

the blue curve should be decomposed to two Gaussian curve one big (red curve) and one small (Yellow). then the formula like
y=y0 + A1/(w1*sqrt(pi/(4*log(2)))) * exp(-4*log(2)*(x-xc1).^2/w1^2) - A2/(w2*sqrt(pi/(4*log(2)))) * exp(-4*log(2)*(x-xc2).^2/w2^2)
where there is a minus sign between Gaussian profiles.
Then I need a customized fit not the two peak normal fitting.

Thank you in advance
Keivan
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000