Skip to content

Commit

Permalink
small bug fix in predict when using list data
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicholas Clark committed Mar 14, 2024
1 parent bf21ec9 commit dc09f31
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions R/predict.mvgam.R
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,8 @@ predict.mvgam = function(object, newdata,

if(!object$use_lv){

if(attr(object$model_data, 'trend_model') %in% c('RW','AR1','AR2','AR3','VAR1')){
if(attr(object$model_data, 'trend_model') %in%
c('RW','AR1','AR2','AR3','VAR1')){
family_pars <- list(sigma_obs = mcmc_chains(object$model_output,
'sigma'))
}
Expand All @@ -211,7 +212,7 @@ predict.mvgam = function(object, newdata,
betas <- matrix(0,
ncol = 1,
nrow = dim(mcmc_chains(object$model_output, 'b'))[1])
Xp <- matrix(1, ncol = 1, nrow = NROW(newdata))
Xp <- matrix(1, ncol = 1, nrow = length(newdata$time))
attr(Xp, 'model.offset') <- 0

# Family parameters spread into a vector
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 dc09f31

Please sign in to comment.