Initial commit
[aggexp.git] / scripts / make_summaries / modele.Rnw
CommitLineData
a961f8a1
BA
1\documentclass[12pt]{article}
2
3\usepackage{geometry}
4\geometry{
5 a4paper,
6 total={210mm,297mm},
7 left=10mm,
8 right=10mm,
9 top=15mm,
10 bottom=15mm,
11}
12\setlength{\parindent}{0pt}
13\usepackage[utf8]{inputenc}
14\usepackage[french]{babel}
15\usepackage{helvet}
16\renewcommand{\familydefault}{\sfdefault}
17\usepackage{amsmath,amsfonts,amssymb}
18\usepackage{float}
19\usepackage{graphicx}
20\usepackage{wrapfig}
21\usepackage{xcolor}
22\usepackage{cprotect}
23%\setcounter{section}{9}
24
25\begin{document}
26
27<<setup, include=FALSE, cache=FALSE, echo=FALSE>>=
28opts_chunk$set(fig.path="figs/", fig.align="center", fig.show="hold", echo=FALSE)
29options(replace.assign=TRUE,width=90)
30@
31
32<<initialize>>=
33library(aggexp)
34station = "STATIONNAME"
35experts = aggexp:::expertsArray[EXPERTSINDICES]
36K = length(experts)
37@
38
39\cprotect\section{\verb|STATIONNAME| - Résumé des données}
40
41\vspace*{-0.5cm}
42<<plotCurves, out.width="12cm", out.height="9cm">>=
43mock_r = list(data = getData(experts, station), experts=experts, stations=station)
44plotCurves(mock_r)
45@
46
47\vspace*{-0.8cm}
48\cprotect\section{\verb|STATIONNAME| - Performances en prédiction}
49
50\vspace*{-0.5cm}
51<<computePredictions>>=
52r_ml = runAlgorithm("ml", experts=experts, stations=station, alpha=0.2, H=183, grad=TRUE)
53r_rr = runAlgorithm("rr", experts=experts, stations=station, H=183)
54r_be = r_ml
55be = which.max(getBestExpert(r_ml))
56r_be$data[,"Prediction"] = r_be$data[,experts[be]]
57@
58
59<<plotPredictionClouds, out.width="6cm", out.height="6cm">>=
60plotCloud(r_be, 30, c(30,50,80), main=paste("Nuage Meilleur Expert (",experts[be],")",sep=""))
61plotCloud(r_ml, 30, c(30,50,80), main="Nuage ML")
62plotCloud(r_rr, 30, c(30,50,80), main="Nuage RR")
63@
64
65\vspace*{-0.8cm}
66\cprotect\section{\verb|STATIONNAME| - Indicateurs d'alertes}
67
68\vspace*{-0.5cm}
69<<computeAlertIndicators>>=
70indicators = matrix(nrow=5, ncol=4+K)
71indicators[,1] = as.numeric(getIndicators(r_ml, thresh=30))
72indicators[,2] = as.numeric(getIndicators(r_rr, thresh=30))
73for (i in 1:K) {
74 r_be$data[,"Prediction"] = r_be$data[,experts[i]]
75 indicators[,i+2] = as.numeric(getIndicators(r_be, thresh=30))
76}
77indicators = as.data.frame(indicators, row.names=c("TS","FA","MA","RMSE","EV"))
78names(indicators) = c("ML","RR", experts)
79@
80
81<<plotAlertIndicators, results="asis">>=
82library(xtable)
83splitIndex = ifelse(length(experts) < 10, 7, 8)
84xtable(indicators[,1:splitIndex], caption="Indicateurs d'alertes ; partie 1")
85xtable(indicators[,(splitIndex+1):(2+K)], caption="Indicateurs d'alertes ; partie 2")
86@
87
88\end{document}