| summary.mcpfit {mcp} | R Documentation |
Summarise mcpfit objects
Description
Summarise parameter estimates and model diagnostics.
Usage
## S3 method for class 'mcpfit'
summary(object, width = 0.95, digits = 2, prior = FALSE, ...)
fixef(object, width = 0.95, prior = FALSE, ...)
ranef(object, width = 0.95, prior = FALSE, ...)
## S3 method for class 'mcpfit'
print(x, ...)
Arguments
object |
An |
width |
Float. The width of the highest posterior density interval (between 0 and 1). |
digits |
a non-null value for digits specifies the minimum number of significant digits to be printed in values. The default, NULL, uses getOption("digits"). (For the interpretation for complex numbers see signif.) Non-integer values will be rounded down, and only values greater than or equal to 1 and no greater than 22 are accepted. |
prior |
TRUE/FALSE. Summarise prior instead of posterior? |
... |
Currently ignored |
x |
An |
Value
A data frame with parameter estimates and MCMC diagnostics.
OBS: The change point distributions are often not unimodal and symmetric so
the intervals can be deceiving Plot them using plot_pars(fit).
-
meanis the posterior mean -
loweris the lower quantile of the highest-density interval (HDI) given inwidth. -
upperis the upper quantile. -
Rhatis the Gelman-Rubin convergence diagnostic which is often taken to be acceptable if < 1.1. It is computed usinggelman.diag. -
n.effis the effective sample size computed usingeffectiveSize. Low effective sample sizes are also obvious as poor mixing in trace plots (seeplot_pars(fit)). Read how to deal with such problems here -
ts_erris the time-series error, taking autoregressive correlation into account. It is computed usingspectrum0.ar.
For simulated data, the summary contains two additional columns so that it is easy to inspect whether the model can recover the parameters. Run simulation and summary multiple times to get a sense of the robustness.
-
simis the value used to generate the data. -
matchis"OK"ifsimis contained in the HDI interval (lowertoupper).
Functions
-
fixef(): Get population-level ("fixed") effects of anmcpfitobject. -
ranef(): Get varying ("random") effects of anmcpfitobject. -
print(mcpfit): Print the posterior summary of anmcpfitobject.
Author(s)
Jonas Kristoffer Lindeløv jonas@lindeloev.dk
Examples
# Typical usage
summary(demo_fit)
summary(demo_fit, width = 0.8, digits = 4) # Set HDI width
# Get the results as a data frame
results = summary(demo_fit)
# Varying (random) effects
# ranef(my_fit)
# Summarise prior
summary(demo_fit, prior = TRUE)