matlab LSQ error calculation computation time

조회 수: 1 (최근 30일)
Simon Philipp Hehenberger
Simon Philipp Hehenberger 2020년 5월 11일
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개)

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by