matlab LSQ error calculation computation time
1 次查看(过去 30 天)
显示 更早的评论
Hi everybody,
I am trying to calculate a simple least squares solution and its corresponding error with the function below. When calculating the error the script slows down significantly. In fact a run with an active profiler shows that 99% of computation time is spent in the line
err=psi'*(I-H*t)*psi.
Can anybody explain why this line is so expensive or give an solution that is faster?
%H: observation matrix,
%I: identiy matrix,
%psi: measurement vector,
%PCO: parameter estimate,
%err: error of the estimate
function [PCO,err]=calcPC_LSQ(H,I,psi)
t=(H'*H)\H';
PCO=t*psi;
err=psi'*(I-H*t)*psi;
end
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!