Browse Source

Readme for weathermod

Petra Lamborn 2 years ago
parent
commit
41f033751a
3 changed files with 20 additions and 0 deletions
  1. 20
    0
      README.md
  2. BIN
      img/tempdetrend-max.png
  3. BIN
      img/tempdetrend.png

+ 20
- 0
README.md View File

@@ -222,3 +222,23 @@ Rscript R/clusterviz.R data/test1kbagg.csv -p "_1kb" --img img/
222 222
 ```
223 223
 
224 224
 Create csv for the pickle created by `clusAssign.py`, then create visualisation plots for all clusters and postfix them with `_1kb` (as in `all_fre_1kb.png`).
225
+
226
+### `fftest.R`
227
+
228
+This is a now-redundant script testing fitting repeating patterns with Fourier transforms.
229
+
230
+### `weathmod.R`
231
+
232
+This script takes the downloaded weather data, (hard-coded path: `../data/2016-18-weather.pkl`) and calculates running last-24-hour minimum and maximum temperatures. It then fits harmonic regressions using the first and second harmonic to de-trend the yearly pattern of each series, saving the resulting dataset at `../data/weatherharm.csv` and stores the models in `../models/weatherMinharmonic.rds` and `../models/weatherMaxharmonic.rds`. These paths can be changed in the source, but there are no command line options.
233
+
234
+Commented out in the source are a number of potentially informative plots showing this process. For example:
235
+
236
+![Detrended maximum daily temperature](img/tempdetrend-max.png)
237
+
238
+Black is observed values; blue is harmonic trend; green is residuals/de-trended data.
239
+
240
+The justification for this is that we want to include the deviation from typical value for that time of year in our model, not the value itself.
241
+
242
+### `combmodels.R`
243
+
244
+This script takes the 

BIN
img/tempdetrend-max.png View File


BIN
img/tempdetrend.png View File