Error estimate in Polyfit

4 visualizzazioni (ultimi 30 giorni)
hu renlin
hu renlin il 15 Mar 2019
Hello,
I'm now reading Moler's Numerical Computing with MATLAB. In M file Cencusgui , in section for error estimate, following lines are written.
Why the error is estimated in this way, would you please provide some theoretical explanation ?
% Provide error estimates for censusgui
switch model
case 'polynomial'
if d > 0
V(:,d+1) = ones(size(t));
s = (t-1955)/55;
for j = d:-1:1
V(:,j) = s.*V(:,j+1);
end
[~,R] = qr(V);
R = R(1:d+1,:);
RI = inv(R);
E = zeros(length(x),d+1);
s = (x-1955)/55;
for j = 1:d+1
E(:,j) = polyval(RI(:,j),s);
end
sig = 10; % Rough estimate
e = sig*sqrt(1+diag(E*E'));
errest = [y-e; NaN; y+e];
else
errest = [y-NaN; NaN; y+NaN];
end

Risposte (0)

Categorie

Scopri di più su Spline Postprocessing in Help Center e File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by