Skip to content
Snippets Groups Projects
Commit a8f93167 authored by pbac's avatar pbac
Browse files

fixed url, submitted again

parent 78264850
No related branches found
No related tags found
No related merge requests found
...@@ -89,7 +89,7 @@ knit_hooks$set(chunk = function(x, options) { ...@@ -89,7 +89,7 @@ knit_hooks$set(chunk = function(x, options) {
``` ```
[onlineforecasting]: https://onlineforecasting.org/articles/onlineforecasting.pdf [onlineforecasting]: https://arxiv.org/abs/2109.12915
[building heat load forecasting]: https://onlineforecasting.org/examples/building-heat-load-forecasting.html [building heat load forecasting]: https://onlineforecasting.org/examples/building-heat-load-forecasting.html
[onlineforecasting.org]: https://onlineforecasting.org [onlineforecasting.org]: https://onlineforecasting.org
<!--shared-init-end--> <!--shared-init-end-->
......
...@@ -89,7 +89,7 @@ knit_hooks$set(chunk = function(x, options) { ...@@ -89,7 +89,7 @@ knit_hooks$set(chunk = function(x, options) {
``` ```
[onlineforecasting]: https://onlineforecasting.org/articles/onlineforecasting.pdf [onlineforecasting]: https://arxiv.org/abs/2109.12915
[building heat load forecasting]: https://onlineforecasting.org/examples/building-heat-load-forecasting.html [building heat load forecasting]: https://onlineforecasting.org/examples/building-heat-load-forecasting.html
[onlineforecasting.org]: https://onlineforecasting.org [onlineforecasting.org]: https://onlineforecasting.org
<!--shared-init-end--> <!--shared-init-end-->
......
...@@ -88,7 +88,7 @@ knit_hooks$set(chunk = function(x, options) { ...@@ -88,7 +88,7 @@ knit_hooks$set(chunk = function(x, options) {
}) })
``` ```
[onlineforecasting]: https://onlineforecasting.org/articles/onlineforecasting.pdf [onlineforecasting]: https://arxiv.org/abs/2109.12915
[building heat load forecasting]: https://onlineforecasting.org/examples/building-heat-load-forecasting.html [building heat load forecasting]: https://onlineforecasting.org/examples/building-heat-load-forecasting.html
[onlineforecasting.org]: https://onlineforecasting.org [onlineforecasting.org]: https://onlineforecasting.org
<!--shared-init-end--> <!--shared-init-end-->
......
...@@ -89,7 +89,7 @@ knit_hooks$set(chunk = function(x, options) { ...@@ -89,7 +89,7 @@ knit_hooks$set(chunk = function(x, options) {
``` ```
[onlineforecasting]: https://onlineforecasting.org/articles/onlineforecasting.pdf [onlineforecasting]: https://arxiv.org/abs/2109.12915
[building heat load forecasting]: https://onlineforecasting.org/examples/building-heat-load-forecasting.html [building heat load forecasting]: https://onlineforecasting.org/examples/building-heat-load-forecasting.html
[onlineforecasting.org]: https://onlineforecasting.org [onlineforecasting.org]: https://onlineforecasting.org
<!--shared-init-end--> <!--shared-init-end-->
......
...@@ -90,7 +90,7 @@ knit_hooks$set(chunk = function(x, options) { ...@@ -90,7 +90,7 @@ knit_hooks$set(chunk = function(x, options) {
``` ```
[onlineforecasting]: https://onlineforecasting.org/articles/onlineforecasting.pdf [onlineforecasting]: https://arxiv.org/abs/2109.12915
[building heat load forecasting]: https://onlineforecasting.org/examples/building-heat-load-forecasting.html [building heat load forecasting]: https://onlineforecasting.org/examples/building-heat-load-forecasting.html
[onlineforecasting.org]: https://onlineforecasting.org [onlineforecasting.org]: https://onlineforecasting.org
<!--shared-init-end--> <!--shared-init-end-->
...@@ -107,7 +107,7 @@ available [here](setup-data.R). More information on [onlineforecasting.org]. ...@@ -107,7 +107,7 @@ available [here](setup-data.R). More information on [onlineforecasting.org].
First load the package: First load the package:
```{r} ```{r}
## Load the package # Load the package
library(onlineforecast) library(onlineforecast)
``` ```
...@@ -118,13 +118,13 @@ heat load forecasting in the building-heat-load-forecasting vignette. ...@@ -118,13 +118,13 @@ heat load forecasting in the building-heat-load-forecasting vignette.
When the package is loaded the data is also loaded, so we can access it When the package is loaded the data is also loaded, so we can access it
directly. Let's start out by: directly. Let's start out by:
```{r} ```{r}
## Keep it in D to simplify notation # Keep it in D to simplify notation
D <- Dbuilding D <- Dbuilding
``` ```
The class is 'data.ĺist': The class is 'data.ĺist':
```{r} ```{r}
## The class of D # The class of D
class(D) class(D)
``` ```
...@@ -134,7 +134,7 @@ order to have functions for the particular format of data - the format is explai ...@@ -134,7 +134,7 @@ order to have functions for the particular format of data - the format is explai
It consists of vectors of time, vectors of observations (model output) and It consists of vectors of time, vectors of observations (model output) and
data.frames of forecasts (model input): data.frames of forecasts (model input):
```{r} ```{r}
## Print the names to see the variables in the data # Print the names to see the variables in the data
names(D) names(D)
``` ```
...@@ -157,7 +157,7 @@ then the check of the variables format is passed. See the help with ...@@ -157,7 +157,7 @@ then the check of the variables format is passed. See the help with
First, lets have a look at `D$t`, which is the vector of time points: First, lets have a look at `D$t`, which is the vector of time points:
```{r} ```{r}
## The time # The time
class(D$t) class(D$t)
head(D$t) head(D$t)
tail(D$t) tail(D$t)
...@@ -188,9 +188,9 @@ operations can be done with: ...@@ -188,9 +188,9 @@ operations can be done with:
A helper function is provided with the `ct` function which can be called using `?`, or `?ct`. See example below: A helper function is provided with the `ct` function which can be called using `?`, or `?ct`. See example below:
```{r} ```{r}
## Convert from a time stamp (tz="GMT" per default) # Convert from a time stamp (tz="GMT" per default)
ct("2019-01-01 11:00") ct("2019-01-01 11:00")
## Convert from unix time # Convert from unix time
ct(3840928387) ct(3840928387)
``` ```
Note that for all functions where a time value as a character is given, the time Note that for all functions where a time value as a character is given, the time
...@@ -220,7 +220,7 @@ str(D$heatload) ...@@ -220,7 +220,7 @@ str(D$heatload)
It must have the same length as the time vector: It must have the same length as the time vector:
```{r} ```{r}
## Same length as time # Same length as time
length(D$t) length(D$t)
length(D$heatload) length(D$heatload)
``` ```
...@@ -233,11 +233,11 @@ plot(D$t, D$heatload, type="l", xlab="Time", ylab="Headload (kW)") ...@@ -233,11 +233,11 @@ plot(D$t, D$heatload, type="l", xlab="Time", ylab="Headload (kW)")
The convention used in all examples is that the time points are always The convention used in all examples is that the time points are always
set to the time interval end point, e.g.: set to the time interval end point, e.g.:
```{r} ```{r}
## The observation # The observation
D$heatload[2] D$heatload[2]
## Represents the average load between # Represents the average load between
D$t[1] D$t[1]
## and # and
D$t[2] D$t[2]
``` ```
The main idea behind setting the time point at the end of the interval is: The main idea behind setting the time point at the end of the interval is:
...@@ -262,18 +262,18 @@ The rules are: ...@@ -262,18 +262,18 @@ The rules are:
Have a look at the forecasts of the global radiation: Have a look at the forecasts of the global radiation:
```{r} ```{r}
## Global radiation forecasts # Global radiation forecasts
head(D$I) head(D$I)
``` ```
At the first time point: At the first time point:
```{r} ```{r}
## First time point # First time point
D$t[1] D$t[1]
``` ```
the available forecast ahead in time is at the first row: the available forecast ahead in time is at the first row:
```{r} ```{r}
## The forecast available ahead in time is in the first row # The forecast available ahead in time is in the first row
D$I[1, ] D$I[1, ]
``` ```
...@@ -289,10 +289,10 @@ the steps are hourly, is an equi-distant time series. Picking out the ...@@ -289,10 +289,10 @@ the steps are hourly, is an equi-distant time series. Picking out the
entire series can be done by `D$I$k8` - hence a plot (together with the entire series can be done by `D$I$k8` - hence a plot (together with the
observations) can be generated by: observations) can be generated by:
```{r} ```{r}
## Just pick some points by # Just pick some points by
i <- 200:296 i <- 200:296
plot(D$t[i], D$I$k8[i], type="l", col=2, xlab="Time", ylab="Global radiation (W/m²)") plot(D$t[i], D$I$k8[i], type="l", col=2, xlab="Time", ylab="Global radiation (W/m²)")
## Add the observations # Add the observations
lines(D$t[i], D$Iobs[i]) lines(D$t[i], D$Iobs[i])
legend("topright", c("8-step forecasts","Observations"), bg="white", lty=1, col=2:1) legend("topright", c("8-step forecasts","Observations"), bg="white", lty=1, col=2:1)
``` ```
...@@ -358,15 +358,15 @@ and note that the forecasts are lagged to be aligned in time. See `?pairs.data.l ...@@ -358,15 +358,15 @@ and note that the forecasts are lagged to be aligned in time. See `?pairs.data.l
Just as a quick side note: This is the principle used for fitting onlineforecast Just as a quick side note: This is the principle used for fitting onlineforecast
models, simply shift forecasts to align with the observations: models, simply shift forecasts to align with the observations:
```{r, fig.width=fhs, fig.height=fhs, out.width=ows} ```{r, fig.width=fhs, fig.height=fhs, out.width=ows}
## Lag the 8-step forecasts to be aligned with the observations # Lag the 8-step forecasts to be aligned with the observations
x <- lagvec(D$I$k8, 8) x <- lagvec(D$I$k8, 8)
## Take a smaller range # Take a smaller range
x <- x[i] x <- x[i]
## Take the observations # Take the observations
y <- D$Iobs[i] y <- D$Iobs[i]
## Fit a linear regression model # Fit a linear regression model
fit <- lm(y ~ x) fit <- lm(y ~ x)
## Plot the result # Plot the result
plot(x, y, xlab="8-step forecasts (W/m²)", ylab="Obsservations (W/m²)", main="Global radiation") plot(x, y, xlab="8-step forecasts (W/m²)", ylab="Obsservations (W/m²)", main="Global radiation")
abline(fit) abline(fit)
``` ```
...@@ -389,7 +389,7 @@ Taking a subset of a `data.list` is very useful and it can easily be done in ...@@ -389,7 +389,7 @@ Taking a subset of a `data.list` is very useful and it can easily be done in
different ways using the `subset` function (i.e. it's really the different ways using the `subset` function (i.e. it's really the
`subset.data.list` function called when: `subset.data.list` function called when:
```{r} ```{r}
## Take the 1 to 4 values of each variable in D # Take the 1 to 4 values of each variable in D
Dsub <- subset(D, 1:4) Dsub <- subset(D, 1:4)
summary(Dsub) summary(Dsub)
``` ```
...@@ -430,11 +430,11 @@ class(Df) ...@@ -430,11 +430,11 @@ class(Df)
After processing it is easily converted back to the `data.list` again by: After processing it is easily converted back to the `data.list` again by:
```{r} ```{r}
## Set back to data.frame # Set back to data.frame
setDF(Df) setDF(Df)
## Convert to a data.list # Convert to a data.list
Dsub2 <- as.data.list(Df) Dsub2 <- as.data.list(Df)
## Compare it with the original Dsub # Compare it with the original Dsub
summary(Dsub2) summary(Dsub2)
summary(Dsub) summary(Dsub)
``` ```
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment