# NOT RUN {
# }
# NOT RUN {
sso <- as.shinystan(X, ...) # replace ... with optional arguments or omit it
launch_shinystan(sso)
# }
# NOT RUN {
# }
# NOT RUN {
########################
### list of matrices ###
########################
# Generate some fake data
chain1 <- cbind(beta1 = rnorm(100), beta2 = rnorm(100), sigma = rexp(100))
chain2 <- cbind(beta1 = rnorm(100), beta2 = rnorm(100), sigma = rexp(100))
sso <- as.shinystan(list(chain1, chain2))
launch_shinystan(sso)
# We can also specify some or all of the optional arguments
# note: in order to use param_dims we need to rename 'beta1' and 'beta2'
# to 'beta[1]' and 'beta[2]'
colnames(chain1) <- colnames(chain2) <- c(paste0("beta[",1:2,"]"), "sigma")
sso2 <- as.shinystan(list(chain1, chain2),
model_name = "Example", warmup = 0,
param_dims = list(beta = 2, sigma = 0))
launch_shinystan(sso2)
# }
# NOT RUN {
# }
# NOT RUN {
######################
### stanfit object ###
######################
library("rstan")
fit <- stan_demo("eight_schools")
sso <- as.shinystan(fit, model_name = "example")
# }
# NOT RUN {
# }
# NOT RUN {
######################
### stanreg object ###
######################
library("rstanarm")
example("example_model")
sso <- as.shinystan(example_model)
launch_shinystan(sso)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab