Skip to content

Commit c6b5bd1

Browse files
author
Nicholas Clark
committed
fix small bug with loo() when newdata was included
1 parent 85862fa commit c6b5bd1

File tree

2 files changed

+1
-1
lines changed

2 files changed

+1
-1
lines changed

R/logLik.mvgam.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ logLik.mvgam = function(object,
119119
series_obs <- as.numeric(all_dat$series)
120120

121121
# Supply forecast NAs if include_forecast is FALSE
122-
if(!is.null(object$test_data) & !include_forecast){
122+
if(!is.null(object$test_data) & !include_forecast & missing(newdata)){
123123
n_fc_obs <- length(object$test_data$y)
124124
n_obs <- length(obs)
125125
obs[((n_obs - n_fc_obs) + 1):n_obs] <- NA

src/mvgam.dll

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)