View source: R/simanalyse-assess.R
sma_assess | R Documentation |
This function is in development. Use at your own risk.
sma_assess( object, expr, data, code, constants = nlist(), nsamples = 100L, statistic = "FT" )
object |
An mcmcr object of results |
expr |
An expression to calculate the expectations, e.g. "X = mu" if the expectation of X is mu |
data |
A dataset |
code |
Code to simulate data |
constants |
Constants to pass with the code |
nsamples |
Number of samples to take from the posterior distribution |
statistic |
A string, one of "FT" (Freeman-Tukey), "LR" (Likelihood Ratio), or "chi2" (Chi-square) |
A flag.
code="for(i in 1:10){ a[i] ~ dpois(mu)}" sims <- sims::sims_simulate(code, parameters=nlist(mu=5), nsims=1) res <- sma_analyse(sims, code, "mu ~ dunif(0,10)", monitor = "mu", deviance=FALSE, mode=sma_set_mode("quick", n.save=300, max.iter=300)) sma_assess(res, expr="a = rep(mu, 10)", sims, code, nsamples=10)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.