extract_diagnostics.stanfit: Extract MCMC convergence and posterior predictive...

Description Usage Arguments Value

Description

Extract MCMC convergence and posterior predictive diagnostics.

Usage

1
2
3
## S3 method for class 'stanfit'
extract_diagnostics(stanfit,
  pars = select_obs_parameters(stanfit), trueParameters = NULL)

Arguments

stanfit

An object returned by either fit or draw_samples.

pars

A vector of characters with the name of the quantities to be extracted. The characters strings may include regular expressions. Further, wildcards are automatically translated into regex: ? matches a single character, while * matches any character string including an empty one. For example, ?pred will match both ypred and zpred, and z* will match zstar and zpred. It defaults to all the observation model parameters.

trueParameters

An optional numeric vector with the true value of the parameter vector.

Value

A named list with two elements. The first element chains is a data.frame with Markov-chain Monte Carlo convergence diagnostics (number of divergences, number of times max tree depth is reached, maximum leapfrogs, warm up and sampling times) and posterior predictive checks (observation ranks, Kolmogorov-Smirnov statistic for observed sample vs posterior predictive samples). The second element, parameters, compare true versus estimated values for the unknown quantities (mean, sd, quantiles and other posterior measures, Monte Carlo standard error, estimated sample size, R Hat, and rank).


luisdamiano/BayesHMM documentation built on May 20, 2019, 2:59 p.m.