Commit | Line | Data |
---|---|---|
ff5df8e3 BA |
1 | { |
2 | "cells": [ | |
3 | { | |
4 | "cell_type": "markdown", | |
83a13103 | 5 | "metadata": {}, |
ff5df8e3 BA |
6 | "source": [ |
7 | "\n", | |
8 | "\n", | |
9 | "<h2>Introduction</h2>\n", | |
10 | "\n", | |
11 | "J'ai fait quelques essais dans différentes configurations pour la méthode \"Neighbors\"\n", | |
6774e53d BA |
12 | "(la seule dont on a parlé) et sa variante récente appelée pour l'instant \"Neighbors2\",\n", |
13 | "avec simtype=\"mix\" : deux types de similarités prises en compte, puis multiplication des poids.\n", | |
14 | "Pour Neighbors on prédit le saut (par la moyenne pondérée des sauts passés), et pour Neighbors2\n", | |
15 | "on n'effectue aucun raccordement (prévision directe).\n", | |
ff5df8e3 | 16 | "\n", |
6774e53d BA |
17 | "J'ai systématiquement comparé à une approche naïve : la moyenne des lendemains des jours\n", |
18 | "\"similaires\" dans tout le passé, ainsi qu'à la persistence -- reproduisant le jour courant ou\n", | |
19 | "allant chercher le futur similaire une semaine avant.\n", | |
ff5df8e3 BA |
20 | "\n", |
21 | "Ensuite j'affiche les erreurs, quelques courbes prévues/mesurées, quelques filaments puis les\n", | |
22 | "histogrammes de quelques poids. Concernant les graphes de filaments, la moitié gauche du graphe\n", | |
23 | "correspond aux jours similaires au jour courant, tandis que la moitié droite affiche les\n", | |
24 | "lendemains : ce sont donc les voisinages tels qu'utilisés dans l'algorithme.\n", | |
25 | "\n" | |
26 | ] | |
27 | }, | |
28 | { | |
29 | "cell_type": "code", | |
30 | "execution_count": null, | |
83a13103 | 31 | "metadata": {}, |
ff5df8e3 BA |
32 | "outputs": [], |
33 | "source": [ | |
34 | "library(talweg)\n", | |
35 | "\n", | |
6774e53d BA |
36 | "P = 7 #instant de prévision\n", |
37 | "H = 17 #horizon (en heures)\n", | |
38 | "\n", | |
ff5df8e3 BA |
39 | "ts_data = read.csv(system.file(\"extdata\",\"pm10_mesures_H_loc_report.csv\",package=\"talweg\"))\n", |
40 | "exo_data = read.csv(system.file(\"extdata\",\"meteo_extra_noNAs.csv\",package=\"talweg\"))\n", | |
6774e53d BA |
41 | "# NOTE: 'GMT' because DST gaps are filled and multiple values merged in above dataset.\n", |
42 | "# Prediction from P+1 to P+H included.\n", | |
43 | "data = getData(ts_data, exo_data, input_tz = \"GMT\", working_tz=\"GMT\", predict_at=P)\n", | |
ff5df8e3 BA |
44 | "\n", |
45 | "indices_ch = seq(as.Date(\"2015-01-18\"),as.Date(\"2015-01-24\"),\"days\")\n", | |
46 | "indices_ep = seq(as.Date(\"2015-03-15\"),as.Date(\"2015-03-21\"),\"days\")\n", | |
6774e53d | 47 | "indices_np = seq(as.Date(\"2015-04-26\"),as.Date(\"2015-05-02\"),\"days\")\n" |
ff5df8e3 BA |
48 | ] |
49 | }, | |
50 | { | |
51 | "cell_type": "markdown", | |
83a13103 | 52 | "metadata": {}, |
ff5df8e3 | 53 | "source": [ |
6774e53d BA |
54 | "\n", |
55 | "\n", | |
ff5df8e3 BA |
56 | "<h2 style=\"color:blue;font-size:2em\">Pollution par chauffage</h2>" |
57 | ] | |
58 | }, | |
59 | { | |
60 | "cell_type": "code", | |
61 | "execution_count": null, | |
83a13103 | 62 | "metadata": {}, |
ff5df8e3 BA |
63 | "outputs": [], |
64 | "source": [ | |
6774e53d | 65 | "p_nn = computeForecast(data, indices_ch, \"Neighbors\", \"Neighbors\", horizon=H)\n", |
83a13103 | 66 | "p_nn2 = computeForecast(data, indices_ch, \"Neighbors2\", \"Zero\", horizon=H)\n", |
6774e53d BA |
67 | "p_az = computeForecast(data, indices_ch, \"Average\", \"Zero\", horizon=H)\n", |
68 | "p_pz = computeForecast(data, indices_ch, \"Persistence\", \"Zero\", horizon=H, same_day=TRUE)" | |
a866acb3 BA |
69 | ] |
70 | }, | |
71 | { | |
72 | "cell_type": "code", | |
73 | "execution_count": null, | |
83a13103 | 74 | "metadata": {}, |
ff5df8e3 BA |
75 | "outputs": [], |
76 | "source": [ | |
6774e53d BA |
77 | "e_nn = computeError(data, p_nn, H)\n", |
78 | "e_nn2 = computeError(data, p_nn2, H)\n", | |
79 | "e_az = computeError(data, p_az, H)\n", | |
80 | "e_pz = computeError(data, p_pz, H)\n", | |
81 | "options(repr.plot.width=9, repr.plot.height=7)\n", | |
82 | "plotError(list(e_nn, e_pz, e_az, e_nn2), cols=c(1,2,colors()[258], 4))\n", | |
83 | "\n", | |
84 | "# Noir: Neighbors, bleu: Neighbors2, vert: moyenne, rouge: persistence\n", | |
85 | "\n", | |
86 | "i_np = which.min(e_nn$abs$indices)\n", | |
87 | "i_p = which.max(e_nn$abs$indices)" | |
ff5df8e3 BA |
88 | ] |
89 | }, | |
90 | { | |
91 | "cell_type": "code", | |
92 | "execution_count": null, | |
83a13103 | 93 | "metadata": {}, |
ff5df8e3 BA |
94 | "outputs": [], |
95 | "source": [ | |
96 | "options(repr.plot.width=9, repr.plot.height=4)\n", | |
97 | "par(mfrow=c(1,2))\n", | |
98 | "\n", | |
6774e53d BA |
99 | "plotPredReal(data, p_nn, i_np); title(paste(\"PredReal nn day\",i_np))\n", |
100 | "plotPredReal(data, p_nn2, i_p); title(paste(\"PredReal nn day\",i_p))\n", | |
101 | "\n", | |
102 | "plotPredReal(data, p_nn2, i_np); title(paste(\"PredReal nn2 day\",i_np))\n", | |
103 | "plotPredReal(data, p_nn2, i_p); title(paste(\"PredReal nn2 day\",i_p))\n", | |
ff5df8e3 | 104 | "\n", |
6774e53d BA |
105 | "plotPredReal(data, p_az, i_np); title(paste(\"PredReal az day\",i_np))\n", |
106 | "plotPredReal(data, p_az, i_p); title(paste(\"PredReal az day\",i_p))\n", | |
ff5df8e3 BA |
107 | "\n", |
108 | "# Bleu: prévue, noir: réalisée" | |
109 | ] | |
110 | }, | |
111 | { | |
112 | "cell_type": "code", | |
113 | "execution_count": null, | |
83a13103 | 114 | "metadata": {}, |
ff5df8e3 BA |
115 | "outputs": [], |
116 | "source": [ | |
117 | "par(mfrow=c(1,2))\n", | |
6774e53d BA |
118 | "f_np = computeFilaments(data, p_nn, i_np, plot=TRUE); title(paste(\"Filaments nn day\",i_np))\n", |
119 | "f_p = computeFilaments(data, p_nn, i_p, plot=TRUE); title(paste(\"Filaments nn day\",i_p))\n", | |
ff5df8e3 | 120 | "\n", |
6774e53d BA |
121 | "f_np2 = computeFilaments(data, p_nn2, i_np, plot=TRUE); title(paste(\"Filaments nn2 day\",i_np))\n", |
122 | "f_p2 = computeFilaments(data, p_nn2, i_p, plot=TRUE); title(paste(\"Filaments nn2 day\",i_p))" | |
ff5df8e3 BA |
123 | ] |
124 | }, | |
125 | { | |
126 | "cell_type": "code", | |
127 | "execution_count": null, | |
83a13103 | 128 | "metadata": {}, |
ff5df8e3 BA |
129 | "outputs": [], |
130 | "source": [ | |
131 | "par(mfrow=c(1,2))\n", | |
83a13103 BA |
132 | "plotFilamentsBox(data, f_np); title(paste(\"FilBox nn day\",i_np))\n", |
133 | "plotFilamentsBox(data, f_p); title(paste(\"FilBox nn day\",i_p))\n", | |
ff5df8e3 | 134 | "\n", |
83a13103 BA |
135 | "# Generally too few neighbors:\n", |
136 | "#plotFilamentsBox(data, f_np2); title(paste(\"FilBox nn2 day\",i_np))\n", | |
ea5c7e56 BA |
137 | "#plotFilamentsBox(data, f_p2); title(paste(\"FilBox nn2 day\",i_p))" |
138 | ] | |
139 | }, | |
140 | { | |
141 | "cell_type": "code", | |
142 | "execution_count": null, | |
83a13103 | 143 | "metadata": {}, |
ff5df8e3 BA |
144 | "outputs": [], |
145 | "source": [ | |
146 | "par(mfrow=c(1,2))\n", | |
6774e53d BA |
147 | "plotRelVar(data, f_np); title(paste(\"StdDev nn day\",i_np))\n", |
148 | "plotRelVar(data, f_p); title(paste(\"StdDev nn day\",i_p))\n", | |
ff5df8e3 | 149 | "\n", |
6774e53d BA |
150 | "plotRelVar(data, f_np2); title(paste(\"StdDev nn2 day\",i_np))\n", |
151 | "plotRelVar(data, f_p2); title(paste(\"StdDev nn2 day\",i_p))\n", | |
ff5df8e3 BA |
152 | "\n", |
153 | "# Variabilité globale en rouge ; sur les 60 voisins (+ lendemains) en noir" | |
154 | ] | |
155 | }, | |
156 | { | |
157 | "cell_type": "code", | |
158 | "execution_count": null, | |
83a13103 | 159 | "metadata": {}, |
ff5df8e3 BA |
160 | "outputs": [], |
161 | "source": [ | |
162 | "par(mfrow=c(1,2))\n", | |
6774e53d BA |
163 | "plotSimils(p_nn, i_np); title(paste(\"Weights nn day\",i_np))\n", |
164 | "plotSimils(p_nn, i_p); title(paste(\"Weights nn day\",i_p))\n", | |
ff5df8e3 | 165 | "\n", |
6774e53d BA |
166 | "plotSimils(p_nn2, i_np); title(paste(\"Weights nn2 day\",i_np))\n", |
167 | "plotSimils(p_nn2, i_p); title(paste(\"Weights nn2 day\",i_p))\n", | |
ff5df8e3 BA |
168 | "\n", |
169 | "# - pollué à gauche, + pollué à droite" | |
170 | ] | |
171 | }, | |
172 | { | |
173 | "cell_type": "code", | |
174 | "execution_count": null, | |
83a13103 | 175 | "metadata": {}, |
ff5df8e3 BA |
176 | "outputs": [], |
177 | "source": [ | |
6774e53d BA |
178 | "# Fenêtres sélectionnées dans ]0,7] / nn à gauche, nn2 à droite\n", |
179 | "p_nn$getParams(i_np)$window\n", | |
180 | "p_nn$getParams(i_p)$window\n", | |
ff5df8e3 | 181 | "\n", |
6774e53d BA |
182 | "p_nn2$getParams(i_np)$window\n", |
183 | "p_nn2$getParams(i_p)$window" | |
ff5df8e3 BA |
184 | ] |
185 | }, | |
186 | { | |
187 | "cell_type": "markdown", | |
83a13103 | 188 | "metadata": {}, |
ff5df8e3 BA |
189 | "source": [ |
190 | "\n", | |
191 | "\n", | |
192 | "<h2 style=\"color:blue;font-size:2em\">Pollution par épandage</h2>" | |
193 | ] | |
194 | }, | |
195 | { | |
196 | "cell_type": "code", | |
197 | "execution_count": null, | |
83a13103 | 198 | "metadata": {}, |
ff5df8e3 BA |
199 | "outputs": [], |
200 | "source": [ | |
6774e53d BA |
201 | "p_nn = computeForecast(data, indices_ep, \"Neighbors\", \"Neighbors\", horizon=H)\n", |
202 | "p_nn2 = computeForecast(data, indices_ep, \"Neighbors2\", \"Zero\", horizon=H)\n", | |
203 | "p_az = computeForecast(data, indices_ep, \"Average\", \"Zero\", horizon=H)\n", | |
204 | "p_pz = computeForecast(data, indices_ep, \"Persistence\", \"Zero\", horizon=H, same_day=TRUE)" | |
ff5df8e3 BA |
205 | ] |
206 | }, | |
207 | { | |
208 | "cell_type": "code", | |
209 | "execution_count": null, | |
83a13103 | 210 | "metadata": {}, |
ff5df8e3 BA |
211 | "outputs": [], |
212 | "source": [ | |
6774e53d BA |
213 | "e_nn = computeError(data, p_nn, H)\n", |
214 | "e_nn2 = computeError(data, p_nn2, H)\n", | |
215 | "e_az = computeError(data, p_az, H)\n", | |
216 | "e_pz = computeError(data, p_pz, H)\n", | |
ff5df8e3 | 217 | "options(repr.plot.width=9, repr.plot.height=7)\n", |
6774e53d | 218 | "plotError(list(e_nn, e_pz, e_az, e_nn2), cols=c(1,2,colors()[258], 4))\n", |
ff5df8e3 | 219 | "\n", |
6774e53d | 220 | "# Noir: Neighbors, bleu: Neighbors2, vert: moyenne, rouge: persistence\n", |
ff5df8e3 | 221 | "\n", |
6774e53d BA |
222 | "i_np = which.min(e_nn$abs$indices)\n", |
223 | "i_p = which.max(e_nn$abs$indices)" | |
ff5df8e3 BA |
224 | ] |
225 | }, | |
226 | { | |
227 | "cell_type": "code", | |
228 | "execution_count": null, | |
83a13103 | 229 | "metadata": {}, |
ff5df8e3 BA |
230 | "outputs": [], |
231 | "source": [ | |
232 | "options(repr.plot.width=9, repr.plot.height=4)\n", | |
233 | "par(mfrow=c(1,2))\n", | |
234 | "\n", | |
6774e53d BA |
235 | "plotPredReal(data, p_nn, i_np); title(paste(\"PredReal nn day\",i_np))\n", |
236 | "plotPredReal(data, p_nn2, i_p); title(paste(\"PredReal nn day\",i_p))\n", | |
ff5df8e3 | 237 | "\n", |
6774e53d BA |
238 | "plotPredReal(data, p_nn2, i_np); title(paste(\"PredReal nn2 day\",i_np))\n", |
239 | "plotPredReal(data, p_nn2, i_p); title(paste(\"PredReal nn2 day\",i_p))\n", | |
ff5df8e3 BA |
240 | "\n", |
241 | "plotPredReal(data, p_az, i_np); title(paste(\"PredReal az day\",i_np))\n", | |
242 | "plotPredReal(data, p_az, i_p); title(paste(\"PredReal az day\",i_p))\n", | |
243 | "\n", | |
244 | "# Bleu: prévue, noir: réalisée" | |
245 | ] | |
246 | }, | |
247 | { | |
248 | "cell_type": "code", | |
249 | "execution_count": null, | |
83a13103 | 250 | "metadata": {}, |
ff5df8e3 BA |
251 | "outputs": [], |
252 | "source": [ | |
253 | "par(mfrow=c(1,2))\n", | |
6774e53d BA |
254 | "f_np = computeFilaments(data, p_nn, i_np, plot=TRUE); title(paste(\"Filaments nn day\",i_np))\n", |
255 | "f_p = computeFilaments(data, p_nn, i_p, plot=TRUE); title(paste(\"Filaments nn day\",i_p))\n", | |
ff5df8e3 | 256 | "\n", |
6774e53d BA |
257 | "f_np2 = computeFilaments(data, p_nn2, i_np, plot=TRUE); title(paste(\"Filaments nn2 day\",i_np))\n", |
258 | "f_p2 = computeFilaments(data, p_nn2, i_p, plot=TRUE); title(paste(\"Filaments nn2 day\",i_p))" | |
ff5df8e3 BA |
259 | ] |
260 | }, | |
261 | { | |
262 | "cell_type": "code", | |
263 | "execution_count": null, | |
83a13103 | 264 | "metadata": {}, |
ff5df8e3 BA |
265 | "outputs": [], |
266 | "source": [ | |
267 | "par(mfrow=c(1,2))\n", | |
6774e53d BA |
268 | "plotFilamentsBox(data, f_np); title(paste(\"FilBox nn day\",i_np))\n", |
269 | "plotFilamentsBox(data, f_p); title(paste(\"FilBox nn day\",i_p))\n", | |
ff5df8e3 | 270 | "\n", |
83a13103 BA |
271 | "# Generally too few neighbors:\n", |
272 | "#plotFilamentsBox(data, f_np2); title(paste(\"FilBox nn2 day\",i_np))\n", | |
273 | "#plotFilamentsBox(data, f_p2); title(paste(\"FilBox nn2 day\",i_p))" | |
ff5df8e3 BA |
274 | ] |
275 | }, | |
276 | { | |
277 | "cell_type": "code", | |
278 | "execution_count": null, | |
83a13103 | 279 | "metadata": {}, |
ff5df8e3 BA |
280 | "outputs": [], |
281 | "source": [ | |
282 | "par(mfrow=c(1,2))\n", | |
6774e53d BA |
283 | "plotRelVar(data, f_np); title(paste(\"StdDev nn day\",i_np))\n", |
284 | "plotRelVar(data, f_p); title(paste(\"StdDev nn day\",i_p))\n", | |
ff5df8e3 | 285 | "\n", |
6774e53d BA |
286 | "plotRelVar(data, f_np2); title(paste(\"StdDev nn2 day\",i_np))\n", |
287 | "plotRelVar(data, f_p2); title(paste(\"StdDev nn2 day\",i_p))\n", | |
ff5df8e3 BA |
288 | "\n", |
289 | "# Variabilité globale en rouge ; sur les 60 voisins (+ lendemains) en noir" | |
290 | ] | |
291 | }, | |
292 | { | |
293 | "cell_type": "code", | |
294 | "execution_count": null, | |
83a13103 | 295 | "metadata": {}, |
ff5df8e3 BA |
296 | "outputs": [], |
297 | "source": [ | |
298 | "par(mfrow=c(1,2))\n", | |
6774e53d BA |
299 | "plotSimils(p_nn, i_np); title(paste(\"Weights nn day\",i_np))\n", |
300 | "plotSimils(p_nn, i_p); title(paste(\"Weights nn day\",i_p))\n", | |
ff5df8e3 | 301 | "\n", |
6774e53d BA |
302 | "plotSimils(p_nn2, i_np); title(paste(\"Weights nn2 day\",i_np))\n", |
303 | "plotSimils(p_nn2, i_p); title(paste(\"Weights nn2 day\",i_p))\n", | |
ff5df8e3 BA |
304 | "\n", |
305 | "# - pollué à gauche, + pollué à droite" | |
306 | ] | |
307 | }, | |
308 | { | |
309 | "cell_type": "code", | |
310 | "execution_count": null, | |
83a13103 | 311 | "metadata": {}, |
ff5df8e3 BA |
312 | "outputs": [], |
313 | "source": [ | |
6774e53d BA |
314 | "# Fenêtres sélectionnées dans ]0,7] / nn à gauche, nn2 à droite\n", |
315 | "p_nn$getParams(i_np)$window\n", | |
316 | "p_nn$getParams(i_p)$window\n", | |
ff5df8e3 | 317 | "\n", |
6774e53d BA |
318 | "p_nn2$getParams(i_np)$window\n", |
319 | "p_nn2$getParams(i_p)$window" | |
ff5df8e3 BA |
320 | ] |
321 | }, | |
322 | { | |
323 | "cell_type": "markdown", | |
83a13103 | 324 | "metadata": {}, |
ff5df8e3 BA |
325 | "source": [ |
326 | "\n", | |
327 | "\n", | |
328 | "<h2 style=\"color:blue;font-size:2em\">Semaine non polluée</h2>" | |
329 | ] | |
330 | }, | |
331 | { | |
332 | "cell_type": "code", | |
333 | "execution_count": null, | |
83a13103 | 334 | "metadata": {}, |
ff5df8e3 BA |
335 | "outputs": [], |
336 | "source": [ | |
6774e53d BA |
337 | "p_nn = computeForecast(data, indices_np, \"Neighbors\", \"Neighbors\", horizon=H)\n", |
338 | "p_nn2 = computeForecast(data, indices_np, \"Neighbors2\", \"Zero\", horizon=H)\n", | |
339 | "p_az = computeForecast(data, indices_np, \"Average\", \"Zero\", horizon=H)\n", | |
340 | "p_pz = computeForecast(data, indices_np, \"Persistence\", \"Zero\", horizon=H, same_day=FALSE)" | |
ff5df8e3 BA |
341 | ] |
342 | }, | |
343 | { | |
344 | "cell_type": "code", | |
345 | "execution_count": null, | |
83a13103 | 346 | "metadata": {}, |
ff5df8e3 BA |
347 | "outputs": [], |
348 | "source": [ | |
6774e53d BA |
349 | "e_nn = computeError(data, p_nn, H)\n", |
350 | "e_nn2 = computeError(data, p_nn2, H)\n", | |
351 | "e_az = computeError(data, p_az, H)\n", | |
352 | "e_pz = computeError(data, p_pz, H)\n", | |
ff5df8e3 | 353 | "options(repr.plot.width=9, repr.plot.height=7)\n", |
6774e53d | 354 | "plotError(list(e_nn, e_pz, e_az, e_nn2), cols=c(1,2,colors()[258], 4))\n", |
ff5df8e3 | 355 | "\n", |
6774e53d | 356 | "# Noir: Neighbors, bleu: Neighbors2, vert: moyenne, rouge: persistence\n", |
ff5df8e3 | 357 | "\n", |
6774e53d BA |
358 | "i_np = which.min(e_nn$abs$indices)\n", |
359 | "i_p = which.max(e_nn$abs$indices)" | |
ff5df8e3 BA |
360 | ] |
361 | }, | |
362 | { | |
363 | "cell_type": "code", | |
364 | "execution_count": null, | |
83a13103 | 365 | "metadata": {}, |
ff5df8e3 BA |
366 | "outputs": [], |
367 | "source": [ | |
368 | "options(repr.plot.width=9, repr.plot.height=4)\n", | |
369 | "par(mfrow=c(1,2))\n", | |
370 | "\n", | |
6774e53d BA |
371 | "plotPredReal(data, p_nn, i_np); title(paste(\"PredReal nn day\",i_np))\n", |
372 | "plotPredReal(data, p_nn2, i_p); title(paste(\"PredReal nn day\",i_p))\n", | |
ff5df8e3 | 373 | "\n", |
6774e53d BA |
374 | "plotPredReal(data, p_nn2, i_np); title(paste(\"PredReal nn2 day\",i_np))\n", |
375 | "plotPredReal(data, p_nn2, i_p); title(paste(\"PredReal nn2 day\",i_p))\n", | |
ff5df8e3 BA |
376 | "\n", |
377 | "plotPredReal(data, p_az, i_np); title(paste(\"PredReal az day\",i_np))\n", | |
378 | "plotPredReal(data, p_az, i_p); title(paste(\"PredReal az day\",i_p))\n", | |
379 | "\n", | |
380 | "# Bleu: prévue, noir: réalisée" | |
381 | ] | |
382 | }, | |
383 | { | |
384 | "cell_type": "code", | |
385 | "execution_count": null, | |
83a13103 | 386 | "metadata": {}, |
ff5df8e3 BA |
387 | "outputs": [], |
388 | "source": [ | |
389 | "par(mfrow=c(1,2))\n", | |
6774e53d BA |
390 | "f_np = computeFilaments(data, p_nn, i_np, plot=TRUE); title(paste(\"Filaments nn day\",i_np))\n", |
391 | "f_p = computeFilaments(data, p_nn, i_p, plot=TRUE); title(paste(\"Filaments nn day\",i_p))\n", | |
ff5df8e3 | 392 | "\n", |
6774e53d BA |
393 | "f_np2 = computeFilaments(data, p_nn2, i_np, plot=TRUE); title(paste(\"Filaments nn2 day\",i_np))\n", |
394 | "f_p2 = computeFilaments(data, p_nn2, i_p, plot=TRUE); title(paste(\"Filaments nn2 day\",i_p))" | |
ff5df8e3 BA |
395 | ] |
396 | }, | |
397 | { | |
398 | "cell_type": "code", | |
399 | "execution_count": null, | |
83a13103 | 400 | "metadata": {}, |
ff5df8e3 BA |
401 | "outputs": [], |
402 | "source": [ | |
403 | "par(mfrow=c(1,2))\n", | |
6774e53d BA |
404 | "plotFilamentsBox(data, f_np); title(paste(\"FilBox nn day\",i_np))\n", |
405 | "plotFilamentsBox(data, f_p); title(paste(\"FilBox nn day\",i_p))\n", | |
ff5df8e3 | 406 | "\n", |
83a13103 BA |
407 | "# Generally too few neighbors:\n", |
408 | "#plotFilamentsBox(data, f_np2); title(paste(\"FilBox nn2 day\",i_np))\n", | |
409 | "#plotFilamentsBox(data, f_p2); title(paste(\"FilBox nn2 day\",i_p))" | |
ff5df8e3 BA |
410 | ] |
411 | }, | |
412 | { | |
413 | "cell_type": "code", | |
414 | "execution_count": null, | |
83a13103 | 415 | "metadata": {}, |
ff5df8e3 BA |
416 | "outputs": [], |
417 | "source": [ | |
418 | "par(mfrow=c(1,2))\n", | |
6774e53d BA |
419 | "plotRelVar(data, f_np); title(paste(\"StdDev nn day\",i_np))\n", |
420 | "plotRelVar(data, f_p); title(paste(\"StdDev nn day\",i_p))\n", | |
ff5df8e3 | 421 | "\n", |
6774e53d BA |
422 | "plotRelVar(data, f_np2); title(paste(\"StdDev nn2 day\",i_np))\n", |
423 | "plotRelVar(data, f_p2); title(paste(\"StdDev nn2 day\",i_p))\n", | |
ff5df8e3 BA |
424 | "\n", |
425 | "# Variabilité globale en rouge ; sur les 60 voisins (+ lendemains) en noir" | |
426 | ] | |
427 | }, | |
428 | { | |
429 | "cell_type": "code", | |
430 | "execution_count": null, | |
83a13103 | 431 | "metadata": {}, |
ff5df8e3 BA |
432 | "outputs": [], |
433 | "source": [ | |
434 | "par(mfrow=c(1,2))\n", | |
6774e53d BA |
435 | "plotSimils(p_nn, i_np); title(paste(\"Weights nn day\",i_np))\n", |
436 | "plotSimils(p_nn, i_p); title(paste(\"Weights nn day\",i_p))\n", | |
ff5df8e3 | 437 | "\n", |
6774e53d BA |
438 | "plotSimils(p_nn2, i_np); title(paste(\"Weights nn2 day\",i_np))\n", |
439 | "plotSimils(p_nn2, i_p); title(paste(\"Weights nn2 day\",i_p))\n", | |
ff5df8e3 BA |
440 | "\n", |
441 | "# - pollué à gauche, + pollué à droite" | |
442 | ] | |
443 | }, | |
444 | { | |
445 | "cell_type": "code", | |
446 | "execution_count": null, | |
83a13103 | 447 | "metadata": {}, |
ff5df8e3 BA |
448 | "outputs": [], |
449 | "source": [ | |
6774e53d BA |
450 | "# Fenêtres sélectionnées dans ]0,7] / nn à gauche, nn2 à droite\n", |
451 | "p_nn$getParams(i_np)$window\n", | |
452 | "p_nn$getParams(i_p)$window\n", | |
ff5df8e3 | 453 | "\n", |
6774e53d BA |
454 | "p_nn2$getParams(i_np)$window\n", |
455 | "p_nn2$getParams(i_p)$window" | |
ff5df8e3 BA |
456 | ] |
457 | } | |
458 | ], | |
83a13103 | 459 | "metadata": {}, |
ff5df8e3 BA |
460 | "nbformat": 4, |
461 | "nbformat_minor": 2 | |
462 | } |