Error estimate in Polyfit

4 ビュー (過去 30 日間)
hu renlin
hu renlin 2019 年 3 月 15 日
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

回答 (0 件)

カテゴリ

Help Center および File ExchangeSpline Postprocessing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by