X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=reports%2Freport.gj;h=5e57660cd0e18e7aecb7e56fa8ddab9d201cfaf2;hb=21c70378d89863afeb124d86989f7f956e280808;hp=1a6b8d9fa9067734459092d4790d79ce8a190e9a;hpb=ea5c7e56ca05a51ce4f0535ffa08cda4c14bff4a;p=talweg.git diff --git a/reports/report.gj b/reports/report.gj index 1a6b8d9..5e57660 100644 --- a/reports/report.gj +++ b/reports/report.gj @@ -1,11 +1,14 @@ -----

Introduction

-J'ai fait quelques essais dans différentes configurations pour la méthode "Neighbors" -(la seule dont on a parlé) et sa variante récente appelée pour l'instant "Neighbors2", -avec simtype="mix" : deux types de similarités prises en compte, puis multiplication des poids. -Pour Neighbors on prédit le saut (par la moyenne pondérée des sauts passés), et pour Neighbors2 -on n'effectue aucun raccordement (prévision directe). +J'ai fait quelques essais dans deux configurations pour la méthode "Neighbors" +(la seule dont on a parlé, incorporant désormais la "variante Bruno/Michel"). + + * avec simtype="mix" et raccordement simple ("Zero") dans le cas "non local", i.e. on va + chercher des voisins n'importe où du moment qu'ils correspondent à deux jours consécutifs sans + valeurs manquantes. + * avec simtype="endo" et raccordement "Neighbor" dans le cas "local" : voisins de même niveau de + pollution et même saison. J'ai systématiquement comparé à une approche naïve : la moyenne des lendemains des jours "similaires" dans tout le passé, ainsi qu'à la persistence -- reproduisant le jour courant ou @@ -40,74 +43,77 @@ indices_np = seq(as.Date("2015-04-26"),as.Date("2015-05-02"),"days") -----

${list_titles[i]}

-----r -p_nn = computeForecast(data, ${list_indices[i]}, "Neighbors", "Neighbors", horizon=H) -p_nn2 = computeForecast(data, ${list_indices[i]}, "Neighbors2", "Zero", horizon=H) -p_az = computeForecast(data, ${list_indices[i]}, "Average", "Zero", horizon=H) -p_pz = computeForecast(data, ${list_indices[i]}, "Persistence", "Zero", horizon=H, same_day=${'TRUE' if loop.index < 2 else 'FALSE'}) +p_n = computeForecast(data, ${list_indices[i]}, "Neighbors", "Zero", horizon=H, + simtype="mix", local=FALSE) +p_l = computeForecast(data, ${list_indices[i]}, "Neighbors", "Neighbors", horizon=H, + simtype="endo", local=TRUE) +p_a = computeForecast(data, ${list_indices[i]}, "Average", "Zero", horizon=H) +p_p = computeForecast(data, ${list_indices[i]}, "Persistence", "Zero", horizon=H, + same_day=${'TRUE' if loop.index < 2 else 'FALSE'}) -----r -e_nn = computeError(data, p_nn, H) -e_nn2 = computeError(data, p_nn2, H) -e_az = computeError(data, p_az, H) -e_pz = computeError(data, p_pz, H) +e_n = computeError(data, p_n, H) +e_l = computeError(data, p_nl, H) +e_a = computeError(data, p_a, H) +e_p = computeError(data, p_p, H) options(repr.plot.width=9, repr.plot.height=7) -plotError(list(e_nn, e_pz, e_az, e_nn2), cols=c(1,2,colors()[258], 4)) +plotError(list(e_n, e_p, e_a, e_l), cols=c(1,2,colors()[258], 4)) -# Noir: Neighbors, bleu: Neighbors2, vert: moyenne, rouge: persistence +# Noir: Neighbors non-local, bleu: Neighbors local, vert: moyenne, rouge: persistence -i_np = which.min(e_nn$abs$indices) -i_p = which.max(e_nn$abs$indices) +i_np = which.min(e_n$abs$indices) +i_p = which.max(e_n$abs$indices) -----r options(repr.plot.width=9, repr.plot.height=4) par(mfrow=c(1,2)) -plotPredReal(data, p_nn, i_np); title(paste("PredReal nn day",i_np)) -plotPredReal(data, p_nn2, i_p); title(paste("PredReal nn day",i_p)) +plotPredReal(data, p_n, i_np); title(paste("PredReal non-loc day",i_np)) +plotPredReal(data, p_n, i_p); title(paste("PredReal non-loc day",i_p)) -plotPredReal(data, p_nn2, i_np); title(paste("PredReal nn2 day",i_np)) -plotPredReal(data, p_nn2, i_p); title(paste("PredReal nn2 day",i_p)) +plotPredReal(data, p_l, i_np); title(paste("PredReal loc day",i_np)) +plotPredReal(data, p_l, i_p); title(paste("PredReal loc day",i_p)) -plotPredReal(data, p_az, i_np); title(paste("PredReal az day",i_np)) -plotPredReal(data, p_az, i_p); title(paste("PredReal az day",i_p)) +plotPredReal(data, p_a, i_np); title(paste("PredReal avg day",i_np)) +plotPredReal(data, p_a, i_p); title(paste("PredReal avg day",i_p)) # Bleu: prévue, noir: réalisée -----r par(mfrow=c(1,2)) -f_np = computeFilaments(data, p_nn, i_np, plot=TRUE); title(paste("Filaments nn day",i_np)) -f_p = computeFilaments(data, p_nn, i_p, plot=TRUE); title(paste("Filaments nn day",i_p)) +f_np_n = computeFilaments(data, p_n, i_np, plot=TRUE); title(paste("Filaments non-loc day",i_np)) +f_p_n = computeFilaments(data, p_n, i_p, plot=TRUE); title(paste("Filaments non-loc day",i_p)) -f_np2 = computeFilaments(data, p_nn2, i_np, plot=TRUE); title(paste("Filaments nn2 day",i_np)) -f_p2 = computeFilaments(data, p_nn2, i_p, plot=TRUE); title(paste("Filaments nn2 day",i_p)) +f_np_l = computeFilaments(data, p_l, i_np, plot=TRUE); title(paste("Filaments loc day",i_np)) +f_p_l = computeFilaments(data, p_l, i_p, plot=TRUE); title(paste("Filaments loc day",i_p)) -----r par(mfrow=c(1,2)) -plotFilamentsBox(data, f_np); title(paste("FilBox nn day",i_np)) -plotFilamentsBox(data, f_p); title(paste("FilBox nn day",i_p)) +plotFilamentsBox(data, f_np_n); title(paste("FilBox non-loc day",i_np)) +plotFilamentsBox(data, f_p_n); title(paste("FilBox non-loc day",i_p)) # Generally too few neighbors: -#plotFilamentsBox(data, f_np2); title(paste("FilBox nn2 day",i_np)) -#plotFilamentsBox(data, f_p2); title(paste("FilBox nn2 day",i_p)) +#plotFilamentsBox(data, f_np_l); title(paste("FilBox loc day",i_np)) +#plotFilamentsBox(data, f_p_l); title(paste("FilBox loc day",i_p)) -----r par(mfrow=c(1,2)) -plotRelVar(data, f_np); title(paste("StdDev nn day",i_np)) -plotRelVar(data, f_p); title(paste("StdDev nn day",i_p)) +plotRelVar(data, f_np_n); title(paste("StdDev non-loc day",i_np)) +plotRelVar(data, f_p_n); title(paste("StdDev non-loc day",i_p)) -plotRelVar(data, f_np2); title(paste("StdDev nn2 day",i_np)) -plotRelVar(data, f_p2); title(paste("StdDev nn2 day",i_p)) +plotRelVar(data, f_np_l); title(paste("StdDev loc day",i_np)) +plotRelVar(data, f_p_l); title(paste("StdDev loc day",i_p)) # Variabilité globale en rouge ; sur les 60 voisins (+ lendemains) en noir -----r par(mfrow=c(1,2)) -plotSimils(p_nn, i_np); title(paste("Weights nn day",i_np)) -plotSimils(p_nn, i_p); title(paste("Weights nn day",i_p)) +plotSimils(p_n, i_np); title(paste("Weights non-loc day",i_np)) +plotSimils(p_n, i_p); title(paste("Weights non-loc day",i_p)) -plotSimils(p_nn2, i_np); title(paste("Weights nn2 day",i_np)) -plotSimils(p_nn2, i_p); title(paste("Weights nn2 day",i_p)) +plotSimils(p_l, i_np); title(paste("Weights loc day",i_np)) +plotSimils(p_l, i_p); title(paste("Weights loc day",i_p)) # - pollué à gauche, + pollué à droite -----r -# Fenêtres sélectionnées dans ]0,7] / nn à gauche, nn2 à droite -p_nn$getParams(i_np)$window -p_nn$getParams(i_p)$window +# Fenêtres sélectionnées dans ]0,7] / non-loc à gauche, loc à droite +p_n$getParams(i_np)$window +p_n$getParams(i_p)$window -p_nn2$getParams(i_np)$window -p_nn2$getParams(i_p)$window +p_l$getParams(i_np)$window +p_l$getParams(i_p)$window % endfor