mcse | R Documentation |
This function returns the Monte Carlo Standard Error (MCSE).
mcse(model, ...)
## S3 method for class 'stanreg'
mcse(model, effects = "fixed", component = "location", parameters = NULL, ...)
model |
A |
... |
Currently not used. |
effects |
Should results for fixed effects ( |
component |
Which type of parameters to return, such as parameters for the conditional model, the zero-inflated part of the model, the dispersion term, etc. See details in section Model Components. May be abbreviated. Note that the conditional component also refers to the count or mean component - names may differ, depending on the modeling package. There are three convenient shortcuts (not applicable to all model classes):
|
parameters |
Regular expression pattern that describes the parameters
that should be returned. Meta-parameters (like |
Monte Carlo Standard Error (MCSE) is another measure of
accuracy of the chains. It is defined as standard deviation of the chains
divided by their effective sample size (the formula for mcse()
is
from Kruschke 2015, p. 187). The MCSE “provides a quantitative
suggestion of how big the estimation noise is”.
Possible values for the component
argument depend on the model class.
Following are valid options:
"all"
: returns all model components, applies to all models, but will only
have an effect for models with more than just the conditional model
component.
"conditional"
: only returns the conditional component, i.e. "fixed
effects" terms from the model. Will only have an effect for models with
more than just the conditional model component.
"smooth_terms"
: returns smooth terms, only applies to GAMs (or similar
models that may contain smooth terms).
"zero_inflated"
(or "zi"
): returns the zero-inflation component.
"location"
: returns location parameters such as conditional
,
zero_inflated
, or smooth_terms
(everything that are fixed or random
effects - depending on the effects
argument - but no auxiliary
parameters).
"distributional"
(or "auxiliary"
): components like sigma
,
dispersion
, beta
or precision
(and other auxiliary parameters) are
returned.
For models of class brmsfit
(package brms), even more options are
possible for the component
argument, which are not all documented in detail
here. See also ?insight::find_parameters
.
Kruschke, J. (2014). Doing Bayesian data analysis: A tutorial with R, JAGS, and Stan. Academic Press.
library(bayestestR)
model <- suppressWarnings(
rstanarm::stan_glm(mpg ~ wt + am, data = mtcars, chains = 1, refresh = 0)
)
mcse(model)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.