TP-traitement-audio-visuel/TP1/exercice_5.m

30 lines
514 B
Mathematica
Raw Normal View History

2023-06-22 18:47:16 +00:00
clear;
close all;
% constantes
beta_0 = 115;
beta_d = 123;
beta = [133, 96, 139, 118];
n_app = 100;
pas_app = 1 / (n_app - 1);
x_j = 0:pas_app:1;
sigma = 0.5;
d = 5;
n = 10000;
beta_moyen = zeros(1, d - 1)';
sigma_moyen = 0;
for i = 1:n
% génération de nouveaux points d'apprentissage
y_j = bezier_bruitee(beta_0, beta, beta_d, x_j, sigma);
D_app = [x_j; y_j];
beta_estime = moindres_carres(D_app, beta_0, beta_d, d);
beta_moyen = beta_moyen + beta_estime / n;
end
[beta', beta_moyen]