From ce87e179c1e39f1e9053bc2a3224ffb84f70d031 Mon Sep 17 00:00:00 2001 From: parulpatil Date: Sun, 21 Jul 2024 16:08:55 -0400 Subject: [PATCH] solutions for GP indent correction --- GP_Solutions.qmd | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/GP_Solutions.qmd b/GP_Solutions.qmd index deaa817..1c7d2c8 100644 --- a/GP_Solutions.qmd +++ b/GP_Solutions.qmd @@ -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 @@ -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. @@ -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.