Skip to content

Commit

Permalink
stanfit wrapper wip, run-extended
Browse files Browse the repository at this point in the history
  • Loading branch information
santikka committed Jul 11, 2024
1 parent 58543f1 commit 5815d70
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
7 changes: 1 addition & 6 deletions R/dynamite.R
Original file line number Diff line number Diff line change
Expand Up @@ -237,12 +237,7 @@ dynamite <- function(dformula, data, time, group = NULL,
# copy so that get_data can still return the full stan_input via debug
stan_input_out <- stan_input
stan_input_out$sampling_vars <- NULL
n_draws <- ifelse_(
is.null(stanfit),
0L,
(stanfit@sim$n_save[1L] - stanfit@sim$warmup2[1L]) *
stanfit@sim$chains
)
n_draws <- ifelse_(is.null(stanfit), 0L, get_ndraws(stanfit))
out <- structure(
list(
stanfit = stanfit,
Expand Down
4 changes: 2 additions & 2 deletions R/stan_utilities.R
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ get_diagnostics.stanfit <- function(x) {
}

get_diagnostics.CmdStanMCMC <- function(x) {
x$diagnostic_summary(x)
x$diagnostic_summary()
}

get_max_treedepth.stanfit <- function(x) {
Expand Down Expand Up @@ -256,7 +256,7 @@ get_draws.stanfit <- function(x, pars) {
}

get_draws.CmdStanMCMC <- function(x, pars) {
x$draws(varibles = pars)
x$draws(variables = pars)
}

get_elapsed_time.stanfit <- function(x) {
Expand Down

0 comments on commit 5815d70

Please sign in to comment.