17 lines
378 B
Plaintext
17 lines
378 B
Plaintext
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
|
|
|