Error estimate in Polyfit
조회 수: 4 (최근 30일)
이전 댓글 표시
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
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Spline Postprocessing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!