diff --git a/R/predict.mvgam.R b/R/predict.mvgam.R index e70f2f72..e59eed84 100644 --- a/R/predict.mvgam.R +++ b/R/predict.mvgam.R @@ -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')) } @@ -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 diff --git a/src/mvgam.dll b/src/mvgam.dll index 4a07a930..de6b889c 100644 Binary files a/src/mvgam.dll and b/src/mvgam.dll differ diff --git a/tests/testthat/Rplots.pdf b/tests/testthat/Rplots.pdf index 8f031b86..2f812dbe 100644 Binary files a/tests/testthat/Rplots.pdf and b/tests/testthat/Rplots.pdf differ