octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Polyfit with scaling - Q regarding polyconf


From: Ben Abbott
Subject: Re: Polyfit with scaling - Q regarding polyconf
Date: Wed, 13 Feb 2008 07:32:09 -0500

I've completed the change to polyfit() and polyval(). However, the tolerance/prediction intervals calculated by my polyconf() need to be compared to Matlab (I've modified polyval to depend upon polyconf).

Thomas, can you run the script below in Matlab and post the result?

r = 0:10:50;
p = poly (r);
p = p / max(abs(p));
x = linspace(0,50,11);
y = polyval(p,x) + 0.25*sin(100*x);
[pf, s] = polyfit (x, y, numel(r));
[y1, delta1] = polyval (pf, x, s);
[y2, delta2] = polyconf (pf, x, s, 'alpha', 0.5, 'predopt', 'curve', 'simopt', 'off');
[y3, delta3] = polyconf (pf, x, s, 'alpha', 0.5, 'predopt', 'curve', 'simopt', 'on');
[y4, delta4] = polyconf (pf, x, s, 'alpha', 0.5, 'predopt', 'observation', 'simopt', 'off');
[y5, delta5] = polyconf (pf, x, s, 'alpha', 0.5, 'predopt', 'observation', 'simopt', 'on');
 
disp (num2str([delta1; delta2; delta3; delta4; delta5]'))

The polyconf() I've written is attached.

What I get using the attached is ...

0.18832    0.13296    0.09848    0.18832    0.13949
0.18134    0.12286   0.091006    0.18134    0.13431
0.16301   0.093733   0.069428    0.16301    0.12074
0.16411   0.095626    0.07083    0.16411    0.12155
0.15845   0.085546   0.063364    0.15845    0.11736
0.16203   0.092008    0.06815    0.16203    0.12001
0.15845   0.085546   0.063364    0.15845    0.11736
0.16411   0.095626    0.07083    0.16411    0.12155
0.16301   0.093733   0.069428    0.16301    0.12074
0.18134    0.12286   0.091006    0.18134    0.13431
0.18832    0.13296    0.09848    0.18832    0.13949

Regarding polyval(), I'm hoping to determine variety of inputs for polyconf() it is equivalent to.

Regarding polyconf(), I'm hoping to determine if I've inferred its operation correctly.

Ben

Attachment: polyconf.m
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]