Skip to content

Commit

Permalink
typo fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicholas Clark committed Apr 23, 2024
1 parent 3d7ce91 commit 30ce194
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 8 deletions.
4 changes: 3 additions & 1 deletion R/forecast.mvgam.R
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,9 @@ forecast.mvgam = function(object,
names(series_fcs) <- levels(data_test$series)

# Extract hindcasts
data_train <- object$obs_data
data_train <- validate_series_time(object$obs_data,
trend_model = attr(object$model_data,
'trend_model'))
ends <- seq(0, dim(mcmc_chains(object$model_output, 'ypred'))[2],
length.out = NCOL(object$ytimes) + 1)
starts <- ends + 1
Expand Down
8 changes: 4 additions & 4 deletions R/hindcast.mvgam.R
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,10 @@ hindcast.mvgam = function(object,
names(series_hcs) <- levels(data_train$series)

series_obs <- lapply(seq_len(n_series), function(series){
s_name <- levels(object$obs_data$series)[series]
data.frame(series = object$obs_data$series,
time = object$obs_data$index..time..index,
y = object$obs_data$y) %>%
s_name <- levels(data_train$series)[series]
data.frame(series = data_train$series,
time = data_train$index..time..index,
y = data_train$y) %>%
dplyr::filter(series == s_name) %>%
dplyr::arrange(time) %>%
dplyr::pull(y)
Expand Down
2 changes: 1 addition & 1 deletion R/mvgam.R
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@
#'mod1 <- mvgam(formula = y ~ s(season, bs = 'cc', k = 6),
#' data = dat$data_train,
#' trend_model = RW(),
#' family = poison(),
#' family = poisson(),
#' use_stan = TRUE,
#' run_model = FALSE)
#'
Expand Down
8 changes: 6 additions & 2 deletions R/plot_mvgam_resids.R
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ plot_mvgam_resids = function(object, series = 1,
}

if(!missing("newdata")){
data_test <- newdata
data_test <- validate_series_time(newdata,
trend_model = attr(object$model_data,
'trend_model'))
}

# Plotting colours
Expand All @@ -55,7 +57,9 @@ c_dark <- c("#8F2727")
c_dark_highlight <- c("#7C0000")

# Prediction indices for the particular series
data_train <- object$obs_data
data_train <- validate_series_time(object$obs_data,
trend_model = attr(object$model_data,
'trend_model'))
ends <- seq(0, dim(mcmc_chains(object$model_output, 'ypred'))[2],
length.out = NCOL(object$ytimes) + 1)
starts <- ends + 1
Expand Down
Binary file modified src/mvgam.dll
Binary file not shown.

0 comments on commit 30ce194

Please sign in to comment.