Skip to content

Commit

Permalink
bug fix converting tau to sigma for autoregressive propagation
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholasjclark committed Nov 13, 2023
1 parent c3c7cd9 commit 2fd6dc9
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion R/forecast.mvgam.R
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ forecast_draws = function(object,
ending_time = ending_time)
}

# Any model in which a an autoregressive process was included should be
# Any model in which an autoregressive process was included should be
# considered as VAR1 for forecasting purposes as this will make use of the
# faster c++ functions
if('Sigma' %in% names(trend_pars) |
Expand Down
4 changes: 2 additions & 2 deletions R/mvgam.R
Original file line number Diff line number Diff line change
Expand Up @@ -1915,7 +1915,7 @@ mvgam = function(formula,
warmup = burnin,
chains = chains,
data = model_data,
cores = 1,
cores = min(c(chains, parallel::detectCores() - 1)),
init = inits,
verbose = FALSE,
thin = thin,
Expand All @@ -1929,7 +1929,7 @@ mvgam = function(formula,
warmup = burnin,
chains = chains,
data = model_data,
cores = min(c(chains, parallel::detectCores() - 1)),
cores = 1,
init = inits,
verbose = FALSE,
thin = thin,
Expand Down
4 changes: 2 additions & 2 deletions R/trends.R
Original file line number Diff line number Diff line change
Expand Up @@ -1122,7 +1122,7 @@ forecast_trend = function(trend_model, use_lv, trend_pars,

# Construct VARMA parameters
if('Sigma' %in% names(trend_pars)){
Sigma <- trend_pars$sigma
Sigma <- trend_pars$Sigma
} else {
Sigma <- rlang::missing_arg()
}
Expand Down Expand Up @@ -1231,7 +1231,7 @@ forecast_trend = function(trend_model, use_lv, trend_pars,
Sigmamat <- matrix(0, nrow = length(trend_pars$last_lvs),
ncol = length(trend_pars$last_lvs),
byrow = TRUE)
diag(Sigmamat) <- 1 / sqrt(trend_pars$tau)
diag(Sigmamat) <- 1 / trend_pars$tau
}


Expand Down
Binary file modified src/mvgam.dll
Binary file not shown.
Binary file modified tests/testthat/Rplots.pdf
Binary file not shown.

0 comments on commit 2fd6dc9

Please sign in to comment.