image
Physics Forums Logo
image
image
* Register * Upgrade Blogs Library Staff Rules Mark Forums Read
image
image   image
image

Go Back   Physics Forums > Mathematics > General Math


Reply

image Lorenzian and gaussian pdf-function fitting with Matlabs nlinfit, confidence interval Share It Thread Tools Search this Thread image
Old Nov27-09, 05:33 AM                  #1
deccard

deccard is Offline:
Posts: 21
Lorenzian and gaussian pdf-function fitting with Matlabs nlinfit, confidence interval

I have data that I want to fit to both Gaussian and Lorentzian (Cauchy) distribution. I have been using Matlab's nlinfit as follows:

gaus = @(p,xdata) (p(1)/(sqrt(2*pi*p(2)))*exp(-(xdata-p(3)).^2/(2*p(2)))+min).*weights;
[g_pfit,g_residual,g_J]=nlinfit(data(:,1), data(:,2).*weights, gaus, [4030 2 -5]);
g_ci=nlparci(g_pfit,g_residual,'jacobian',J,'alpha ',0.317);

loren = @(p,xdata) p(1)./(pi*p(2)*(1+((xdata-p(3))./p(2)).^2))+p(4);
[l_pfit,l_residual,l_J]=nlinfit(data(:,1), data(:,2), loren, [10030 0.5 -5 4]);
l_ci=nlparci(l_pfit,l_residual,'jacobian',l_J,'alp ha',0.317);

The strange thing, however, is that my data is more like Gaussian-shaped and Gaussian curve, is by eye way more better fit. Still I get smaller errors for the width of Lorentzian fit than Gaussian (using the nlparci function).

Why would I get smaller errors for the width of the Lorentzian curve than for the width of the Gaussian curve, which is a better fit?

deccard
  Reply With Quote
image image
Reply

Tags
error, gaussian, lorentzian, matlab, nlinfit
Thread Tools


Similar Threads for: Lorenzian and gaussian pdf-function fitting with Matlabs nlinfit, confidence interval
Thread Thread Starter Forum Replies Last Post
Confidence Interval Melawrghk Calculus & Beyond 3 Jun25-09 01:36 AM
Confidence Interval for a function of a parameter alexhleb366 Set Theory, Logic, Probability, Statistics 1 May25-09 03:32 PM
Confidence interval twoflower Calculus & Beyond 1 Sep11-08 07:02 PM
value of za/2 for 85% confidence interval? Agent_J Set Theory, Logic, Probability, Statistics 0 Apr5-06 01:20 AM
confidence interval vptran84 Set Theory, Logic, Probability, Statistics 1 May10-05 04:49 AM

Powered by vBulletin Copyright ©2000 - 2010, Jelsoft Enterprises Ltd. © 2009 Physics Forums
Sciam | physorgPhysorg.com Science News Partner
image
image   image