prepare report on one full year (2015)
[talweg.git] / reports / year2015.gj
CommitLineData
f71b975b
BA
1-----r
2library(talweg)
3
4P = ${P} #première heure de prévision
5H = ${H} #dernière heure de prévision
6
7ts_data = read.csv(system.file("extdata","pm10_mesures_H_loc.csv",
8 package="talweg"))
9exo_data = read.csv(system.file("extdata","meteo_extra_noNAs.csv",
10 package="talweg"))
11data = getData(ts_data, exo_data)
12
13indices = seq(as.Date("2015-01-01"),as.Date("2015-12-31"),"days")
14-----r
15p1 = computeForecast(data, indices, "Neighbors", "Neighbors",
16 predict_from=P, horizon=H, simtype="mix", local=FALSE)
17p2 = computeForecast(data, indices, "Neighbors", NULL,
18 predict_from=P, horizon=H, simtype="none", local=TRUE)
19p3 = computeForecast(data, indices, "Average", "Zero",
20 predict_from=P, horizon=H)
21p4 = computeForecast(data, indices, "Persistence", "Zero",
22 predict_from=P, horizon=H, same_day=TRUE)
23-----r
24e1 = computeError(data, p1, P, H)
25e2 = computeError(data, p2, P, H)
26e3 = computeError(data, p3, P, H)
27e4 = computeError(data, p4, P, H)
28options(repr.plot.width=9, repr.plot.height=7)
29plotError(list(e1, e4, e3, e2), cols=c(1,2,colors()[258],4))
30
31# noir: Neighbors non-local (p1), bleu: Neighbors local (p2),
32# vert: moyenne (p3), rouge: persistence (p4)
33
34## TODO: plot modifié, retourner jour par jour et agréger au mois
35
36## TODO: garder éventuellement ça ::
37sum_p23 = e2$abs$indices + e3$abs$indices
38i_np = which.min(sum_p23) #indice de jour "facile"
39i_p = which.max(sum_p23) #indice de jour "difficile"
40% if P == 8:
41-----r
42options(repr.plot.width=9, repr.plot.height=4)
43par(mfrow=c(1,2))
44
45plotPredReal(data, p1, i_np); title(paste("PredReal p1 day",i_np))
46plotPredReal(data, p1, i_p); title(paste("PredReal p1 day",i_p))
47
48plotPredReal(data, p2, i_np); title(paste("PredReal p2 day",i_np))
49plotPredReal(data, p2, i_p); title(paste("PredReal p2 day",i_p))
50
51# Bleu : prévue ; noir : réalisée (confondues jusqu'à predict_from-1)