Skip to content

Commit

Permalink
Add khat summary to cmdstanr-based variational stanfit
Browse files Browse the repository at this point in the history
  • Loading branch information
lunafazio authored Nov 10, 2023
1 parent 37a135f commit 553ee5c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion R/backends.R
Original file line number Diff line number Diff line change
Expand Up @@ -943,7 +943,7 @@ read_csv_as_stanfit <- function(files, variables = NULL,
sdate <- do.call(max, lapply(files, function(csv) file.info(csv)$mtime))
sdate <- format(sdate, "%a %b %d %X %Y")

new(
out <- new(
"stanfit",
model_name = model_name,
model_pars = svars,
Expand All @@ -956,4 +956,7 @@ read_csv_as_stanfit <- function(files, variables = NULL,
date = sdate, # not the time of sampling
.MISC = new.env(parent = emptyenv())
)
assign("summary", rstan:::summary_sim(out@sim), envir = out@.MISC)
out@.MISC$summary$khat <- NA
out
}

0 comments on commit 553ee5c

Please sign in to comment.