
Summarize a mixture model
summary.mixglm.RdThis function calculates posterior quantiles of parameters of a mixture model across all chains or for each chain separately
Usage
# S3 method for class 'mixglm'
summary(
object,
byChains = FALSE,
digit = 4L,
absInt = FALSE,
randomSample = NULL,
...
)Arguments
- object
an object of class "mixglm"
- byChains
logical value indicating if the summary should be calculated for each chain separately
- digit
integer specifying the number of decimal places to be used. Use
"NULL"for no rounding.- absInt
logical value indicating if intercepts for state values should be absolute (by default, they represent differences)
- randomSample
integer specifying how many random samples from posterior distribution to take instead of summary. Use
"NULL"for summary.- ...
further arguments passed to or from other methods.
Value
Returns a list with one item being data.frame of quantiles of
posterior distributions of parameters. If byChains is TRUE,
a data.frame is returned for each chain.
Examples
if (FALSE) { # \dontrun{
set.seed(10)
n <- 200
x <- rnorm(n)
group <- rbinom(n, 1, 0.5)
y <- rnorm(n, 1 + 0.5 * x * c(-1, 1)[group + 1], 0.1)
plot(y ~ x)
dat <- data.frame(x, y)
mod <- mixglm(
stateValModels = y ~ x,
stateProbModels = ~ x,
statePrecModels = ~ x,
inputData = dat,
numStates = 2)
summary(mod)
# random samples of parameters from posterior distribution
summary(mod, randomSample = 5)} # }