From 929df1c29db52cc8a564f230def4a1bcffe86715 Mon Sep 17 00:00:00 2001 From: Cole-Monnahan-NOAA Date: Fri, 31 May 2024 14:50:41 -0700 Subject: [PATCH] Add timing to sparse method --- R/sparse.R | 2 ++ 1 file changed, 2 insertions(+) diff --git a/R/sparse.R b/R/sparse.R index 4caba8a..36ce256 100644 --- a/R/sparse.R +++ b/R/sparse.R @@ -101,10 +101,12 @@ as.tmbfit <- function(x, mle, invf){ for(chain in 1:max(sp$.chain)){ spl[[chain]] <- as.matrix(sp[sp$.chain==chain,1:6]) } + timing <- sapply(x@timing, function(x) unlist(x)) x <- list(samples=post, sampler_params=spl, mle=mle, monitor=mon, model='test', max_treedepth=x@metadata$max_depth, warmup=as.numeric(x@metadata$num_warmup), + time.warmup=timing[1,], time.total=timing[1,]+timing[,2], ## iter=as.numeric(x@metadata$num_samples)+as.numeric(x@metadata$num_warmup), algorithm='NUTS') adfit(x)