|
@@ -19,7 +19,8 @@ clusters <- levels(aggdf$cluster)
|
19
|
19
|
str(aggdf)
|
20
|
20
|
mtempdf <- read.csv("../data/weatherharm.csv", stringsAsFactors = FALSE) %>%
|
21
|
21
|
mutate(x = as.POSIXct(x, tz = "UTC")) %>%
|
22
|
|
- rename(read_time = x, rollingmin = y, fitmin = f, resmin = r)
|
|
22
|
+ rename(read_time = x, rollingmin = y.min, fitmin = f.min, resmin = r.min,
|
|
23
|
+ rollingmax = y.max, fitmax = f.max, resmax = r.max)
|
23
|
24
|
str(mtempdf)
|
24
|
25
|
sns <- import("seaborn")
|
25
|
26
|
cbp <- as.character(p$Series(sns$color_palette("colorblind", as.integer(9))$as_hex()))
|
|
@@ -50,10 +51,13 @@ ycols <- paste(colnames(harm.y), collapse = " + ")
|
50
|
51
|
wcols <- paste(colnames(harm.w), collapse = " + ")
|
51
|
52
|
dcols <- paste(colnames(harm.d), collapse = " + ")
|
52
|
53
|
|
53
|
|
-nform.full <- sprintf("kwh ~ %s + %s + %s + (%s):(%s) + (%s):(%s) + (%s):(%s) + resmin + resmin:(%s) + resmin:(%s) + resmin:(%s)",
|
54
|
|
- ycols, wcols, dcols, ycols, wcols, ycols, dcols, wcols, dcols, ycols, wcols, dcols) %>% formula()
|
55
|
|
-nform.comp <- sprintf("kwh ~ %s + %s + %s + (%s):(%s) + (%s):(%s) + resmin + resmin:(%s) + resmin:(%s) + resmin:(%s)",
|
56
|
|
- ycols, wcols, dcols, ycols, dcols, wcols, dcols, ycols, wcols, dcols) %>% formula()
|
|
54
|
+nform.full <- sprintf(paste0("kwh ~ %s + %s + %s + (%s):(%s) + (%s):(%s) + (%s):(%s) + resmin",
|
|
55
|
+ " + resmin:(%s) + resmin:(%s) + resmin:(%s)",
|
|
56
|
+ " + resmax + resmax:(%s) + resmax:(%s) + resmax:(%s)"),
|
|
57
|
+ ycols, wcols, dcols, ycols, wcols, ycols, dcols, wcols, dcols, ycols, wcols, dcols, ycols, wcols, dcols) %>% formula()
|
|
58
|
+nform.comp <- sprintf(paste0("kwh ~ %s + %s + %s + (%s):(%s) + (%s):(%s) + resmin + resmin:(%s) + resmin:(%s) + resmin:(%s)",
|
|
59
|
+ " + resmax + resmax:(%s) + resmax:(%s) + resmax:(%s)"),
|
|
60
|
+ ycols, wcols, dcols, ycols, dcols, wcols, dcols, ycols, wcols, dcols, ycols, wcols, dcols) %>% formula()
|
57
|
61
|
nform.now <- sprintf("kwh ~ %s + %s + %s + (%s):(%s) + (%s):(%s)",
|
58
|
62
|
ycols, wcols, dcols, ycols, dcols, wcols, dcols) %>% formula()
|
59
|
63
|
nform.min <- formula("kwh ~ 1")
|
|
@@ -116,3 +120,6 @@ predplot <-ggplot(predf, aes(x = x, y = y)) + geom_line(aes(y = f), color = "blu
|
116
|
120
|
predplot
|
117
|
121
|
|
118
|
122
|
predplot + coord_cartesian(xlim = c(as.POSIXct("2018-03-01", tz = "UTC"), as.POSIXct("2018-04-01", tz = "UTC")))
|
|
123
|
+
|
|
124
|
+mean(abs(predf$r))
|
|
125
|
+sd(predf$r)
|