TP-traitement-audio-visuel/TP2/moindres_carres_ecretes.asv

17 lines
378 B
Plaintext
Raw Normal View History

2023-06-22 18:47:16 +00:00
function estimation = moindres_carres_ecretes(D_app,beta_0,beta_d,d,lambda)
X = D_app(1,:)';
Y = D_app(2,:)';
[A, B, beta_chapeau] = moindres_carres(D_app, beta_0, beta_d, d);
slope = (beta_d - beta_0) / (X(length(X)) - X(1));
beta_barre = slope*X + beta_0;
C = B - A * beta_chapeau';
delta_chapeau = (A' * A + lambda * eye(d-1)) \ A' * C
end