|
From: <pl...@pi...> - 2012-10-17 20:46:52
|
Hi,
I was just trying to do a fit command on some data but excluding a
certain range where the data is perturbed by something else.
I ttied an analogous method to using NaN in plot where points evaluating
to NaN get ignored. However it seems that with fit they are counted
which basically screws things up entirely.
fit [:2001] ts_model(x) datafile using 1:2 via x1,a1,p1, x2,a2,p2,a3,p3,x3
After 1 iterations the fit converged.
final sum of squares of residuals : nan
abs. change during last iteration : nan
degrees of freedom (FIT_NDF) : 169
rms of residuals (FIT_STDFIT) = sqrt(WSSR/ndf) : nan
variance of residuals (reduced chisquare) = WSSR/ndf : nan
Final set of parameters Asymptotic Standard Error
======================= ==========================
x1 = nan +/- nan (nan%)
a1 = 0.01 +/- nan (nan%)
p1 = 3 +/- nan (nan%)
x2 = nan +/- nan (nan%)
a2 = 0.01 +/- nan (nan%)
p2 = 20 +/- nan (nan%)
a3 = 0.01 +/- nan (nan%)
p3 = 60 +/- nan (nan%)
x3 = 2006.12 +/- nan (nan%)
correlation matrix of the fit parameters:
x1 a1 p1 x2 a2 p2 a3 p3
x3
x1 nan
a1 nan nan
p1 nan nan nan
x2 nan nan nan nan
a2 nan nan nan nan nan
p2 nan nan nan nan nan nan
a3 nan nan nan nan nan nan nan
p3 nan nan nan nan nan nan nan nan
x3 nan nan nan nan nan nan nan nan
nan
gnuplot> fit [:2001] ts_model(x) datafile using
1:((($1<1980)&&($1>1984))?$2:NaN) via x1,a1,p1, x2,a2,p2,a3,p3,x3
Now I can see how this would be happening but I wonder if it has any use
at all as a result.
In practice this means that any dataset that contains even one NaN
coordinate or one point where 'using' evaluates to NaN, cannot be used
with the fit command.
Now since plot and fit generally try to work in a parallel fashion, I
was expecting fit to _exclude_ from its calculations the points that I
had made evaluate to NaN.
If this worked , it would be fundamentally useful. Is there any reason
why the current behaviour is useful or essential.
Would it be preferable to simply skip data points with a NaN in a
similar way to what plot does?
best regards, Peter.
|