Skip to content

Commit

Permalink
solutions for GP indent correction
Browse files Browse the repository at this point in the history
  • Loading branch information
parulvijay committed Jul 21, 2024
1 parent 2cbf169 commit ce87e17
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions GP_Solutions.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,7 @@ df <- df[, c("datetime", "observation")]
cutoff = as.Date('2020-12-31')
df_train <- subset(df, df$datetime <= cutoff)
df_test <- subset(df, df$datetime > cutoff)
```

## GP Model
Now we will setup our X's. We already have the functions to do this and can simply pass in the datetime. We then combine $X_1$ and $X_2$ to create out input matrix $X$. Remember, everything is ordered as in our dataset.

```{r}
# Setting up iso-week and sin wave predictors by calling the functions
X1 <- fx.iso_week(df_train$datetime) # range is 1-53
X2 <- fx.sin(df_train$datetime) # range is 0 to 1
Expand Down Expand Up @@ -199,7 +193,7 @@ rmse <- sqrt(mean((yt_true - yt_pred)^2))
rmse
```

### Use an environmental predictor in your model. Following is a function `fx.green` that creates the variable given the `datetime` and the `location`.
###### Use an environmental predictor in your model. Following is a function `fx.green` that creates the variable given the `datetime` and the `location`.

Here is a snippet of the supporting file that you will use; You can look into the data.frame and try to plot `ker` for one site at a time and see what it yields.

Expand Down Expand Up @@ -342,7 +336,7 @@ rmse <- sqrt(mean((yt_true - yt_pred)^2))
rmse
```

### Fit a GP Model for all the locations (*More advanced*).
###### Fit a GP Model for all the locations (*More advanced*).

```{r}
# GP function. This can be varied but easiest way is to just take in X, y, XX and return the predicted means and bounds.
Expand Down

0 comments on commit ce87e17

Please sign in to comment.