README.md

stanutils

Build Status codecov

Some helper functions for stan.

Installation

devtools::install_github("paasim/stanutils")

Example

library(rstan)
library(stanutils)
m1 <- "
parameters {
  vector[3] y;
}
model {
  y ~ std_normal();
}"
fit <- stan(model_code = m1, iter = 300, chains = 2, seed = 456, cores = 1)

# summary as a tibble
summary_tidy(fit)

# extract the sample for y
e <- extract_tidy(fit, y)
e
# mean for each element of the vector
sum_samp_with(e, d1)


paasim/stanutils documentation built on July 19, 2019, 12:47 a.m.