Choose post-warumps samples by their ordinal position from each parameter in a stanfit object

stan_slice(object, ..., inc_warmup = TRUE)

Arguments

object

stanfit object

...

Integer samples values

inc_warmup

logical, include warmup in output, Default: TRUE

Value

stanfit object

See also

Other filtering: stan_filter(), stan_thin_n()

Examples

# \donttest{ rats <- rats_example(nCores = 1) rats%>% stan_select(mu_alpha)%>% stan_slice(1:30)
#> Inference for Stan model: rats. #> 4 chains, each with iter=1030; warmup=1000; thin=1; #> post-warmup draws per chain=30, total post-warmup draws=120. #> #> mean se_mean sd 2.5% 25% 50% 75% 97.5% n_eff Rhat #> mu_alpha 242.34 0.14 2.27 238.35 240.75 242.24 243.87 247.16 250 1 #> #> Samples were drawn using at Mon Aug 31 11:07:31 2020. #> For each parameter, n_eff is a crude measure of effective sample size, #> and Rhat is the potential scale reduction factor on split chains (at #> convergence, Rhat=1).
rats%>% stan_select(mu_alpha)%>% stan_slice(1:30,inc_warmup = FALSE)
#> Inference for Stan model: rats. #> 4 chains, each with iter=30; warmup=0; thin=1; #> post-warmup draws per chain=30, total post-warmup draws=120. #> #> mean se_mean sd 2.5% 25% 50% 75% 97.5% n_eff Rhat #> mu_alpha 242.34 0.14 2.27 238.35 240.75 242.24 243.87 247.16 250 1 #> #> Samples were drawn using at Mon Aug 31 11:07:31 2020. #> For each parameter, n_eff is a crude measure of effective sample size, #> and Rhat is the potential scale reduction factor on split chains (at #> convergence, Rhat=1).
# }