matlab - Poor fit with nlinfit -
i'm having fitting issues nlinfit. can't seem figure out how improve fit. decreasing tolx or tolfun has not changed value in coeffs.
model = @(a,x) 1./(1 + a*x.^2); model0 = [1e13]; opts = statset('tolx', 1e-25, 'tolfun', 1e-25); coeffs = nlinfit(freqdata, noisedata, model, model0, opts);
here's fit. http://i.imgur.com/v1dkd4x.png
it seems dealing small numbers there might floating point precision issue. why won't transform expression different from, fit, inverse transform? example:
take 1/model
transformation, have simple polynomial fitting,
model_new=(x,a)=1+a*x.^2
where can use polyfit
, polyval
, take 1/result
...
Comments
Post a Comment