X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=reports%2Freport.gj;h=39326395cd64d4c7457fead0e004f67cf7386569;hb=d09b09b0c811305405caf871d467f1a5ab34770f;hp=a9f10d0e4d54630df60cad52e5e026ddb257e2bd;hpb=63ff1ecbd80adfe347faa0d954f526d15f033c22;p=talweg.git diff --git a/reports/report.gj b/reports/report.gj index a9f10d0..3932639 100644 --- a/reports/report.gj +++ b/reports/report.gj @@ -1,6 +1,5 @@ ----- - -## Introduction +

Introduction

J'ai fait quelques essais dans différentes configurations pour la méthode "Neighbors" (la seule dont on a parlé).
Il semble que le mieux soit @@ -22,44 +21,45 @@ lendemains : ce sont donc les voisinages tels qu'utilisés dans l'algorithme. list_titles = ['Pollution par chauffage', 'Pollution par épandage', 'Semaine non polluée'] list_indices = ['indices_ch', 'indices_ep', 'indices_np'] %> - -----r - library(talweg) +P = ${P} #instant de prévision +H = ${H} #horizon (en heures) + ts_data = read.csv(system.file("extdata","pm10_mesures_H_loc_report.csv",package="talweg")) exo_data = read.csv(system.file("extdata","meteo_extra_noNAs.csv",package="talweg")) -data = getData(ts_data, exo_data, input_tz = "Europe/Paris", working_tz="Europe/Paris", predict_at=13) +data = getData(ts_data, exo_data, input_tz = "Europe/Paris", working_tz="Europe/Paris", + predict_at=P) #predict from P+1 to P+H included indices_ch = seq(as.Date("2015-01-18"),as.Date("2015-01-24"),"days") indices_ep = seq(as.Date("2015-03-15"),as.Date("2015-03-21"),"days") indices_np = seq(as.Date("2015-04-26"),as.Date("2015-05-02"),"days") -% for loop in range(3): - +% for i in range(3): ----- - -

${list_titles[loop]}

- +

${list_titles[i]}

-----r -p_nn_exo = computeForecast(data, ${list_indices[loop]}, "Neighbors", "Neighbors", simtype="exo", horizon=H) -p_nn_mix = computeForecast(data, ${list_indices[loop]}, "Neighbors", "Neighbors", simtype="mix", horizon=H) -p_az = computeForecast(data, ${list_indices[loop]}, "Average", "Zero", horizon=H) #, memory=183) -p_pz = computeForecast(data, ${list_indices[loop]}, "Persistence", "Zero", horizon=H, same_day=TRUE) - +p_nn_exo = computeForecast(data, ${list_indices[i]}, "Neighbors", "Neighbors", + horizon=H, simtype="exo") +p_nn_mix = computeForecast(data, ${list_indices[i]}, "Neighbors", "Neighbors", + horizon=H, simtype="mix") +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'}) -----r -e_nn_exo = computeError(data, p_nn_exo) -e_nn_mix = computeError(data, p_nn_mix) -e_az = computeError(data, p_az) -e_pz = computeError(data, p_pz) +e_nn_exo = computeError(data, p_nn_exo, H) +e_nn_mix = computeError(data, p_nn_mix, H) +e_az = computeError(data, p_az, H) +e_pz = computeError(data, p_pz, H) options(repr.plot.width=9, repr.plot.height=7) plotError(list(e_nn_mix, e_pz, e_az, e_nn_exo), cols=c(1,2,colors()[258], 4)) -#Noir: neighbors_mix, bleu: neighbors_exo, vert: moyenne, rouge: persistence +# Noir: neighbors_mix, bleu: neighbors_exo, vert: moyenne, rouge: persistence i_np = which.min(e_nn_exo$abs$indices) i_p = which.max(e_nn_exo$abs$indices) - -----r options(repr.plot.width=9, repr.plot.height=4) par(mfrow=c(1,2)) @@ -73,8 +73,7 @@ plotPredReal(data, p_nn_mix, i_p); title(paste("PredReal nn mix 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)) -#Bleu: prévue, noir: réalisée - +# Bleu: prévue, noir: réalisée -----r par(mfrow=c(1,2)) f_np_exo = computeFilaments(data, p_nn_exo, i_np, plot=TRUE); title(paste("Filaments nn exo day",i_np)) @@ -82,7 +81,6 @@ f_p_exo = computeFilaments(data, p_nn_exo, i_p, plot=TRUE); title(paste("Filamen f_np_mix = computeFilaments(data, p_nn_mix, i_np, plot=TRUE); title(paste("Filaments nn mix day",i_np)) f_p_mix = computeFilaments(data, p_nn_mix, i_p, plot=TRUE); title(paste("Filaments nn mix day",i_p)) - -----r par(mfrow=c(1,2)) plotFilamentsBox(data, f_np_exo); title(paste("FilBox nn exo day",i_np)) @@ -90,7 +88,6 @@ plotFilamentsBox(data, f_p_exo); title(paste("FilBox nn exo day",i_p)) plotFilamentsBox(data, f_np_mix); title(paste("FilBox nn mix day",i_np)) plotFilamentsBox(data, f_p_mix); title(paste("FilBox nn mix day",i_p)) - -----r par(mfrow=c(1,2)) plotRelVar(data, f_np_exo); title(paste("StdDev nn exo day",i_np)) @@ -99,30 +96,26 @@ plotRelVar(data, f_p_exo); title(paste("StdDev nn exo day",i_p)) plotRelVar(data, f_np_mix); title(paste("StdDev nn mix day",i_np)) plotRelVar(data, f_p_mix); title(paste("StdDev nn mix day",i_p)) -#Variabilité globale en rouge ; sur les 60 voisins (+ lendemains) en noir - +# Variabilité globale en rouge ; sur les 60 voisins (+ lendemains) en noir -----r par(mfrow=c(1,2)) plotSimils(p_nn_exo, i_np); title(paste("Weights nn exo day",i_np)) plotSimils(p_nn_exo, i_p); title(paste("Weights nn exo day",i_p)) plotSimils(p_nn_mix, i_np); title(paste("Weights nn mix day",i_np)) -plotSimils(p_nn_mix, i_p); title(paste("Weights nn mix day",i_p) - -#- pollué à gauche, + pollué à droite +plotSimils(p_nn_mix, i_p); title(paste("Weights nn mix day",i_p)) +# - pollué à gauche, + pollué à droite -----r -#Fenêtres sélectionnées dans ]0,10] / endo à gauche, exo à droite +# Fenêtres sélectionnées dans ]0,10] / endo à gauche, exo à droite p_nn_exo$getParams(i_np)$window p_nn_exo$getParams(i_p)$window p_nn_mix$getParams(i_np)$window p_nn_mix$getParams(i_p)$window - % endfor - ----- -## Bilan +

Bilan

Problème difficile : on ne fait guère mieux qu'une naïve moyenne des lendemains des jours similaires dans le passé, ce qui n'est pas loin de prédire une série constante égale à la