The extract_* family of methods returns elements from a fit object (including fixed and estimated quantities, as well as internal elements of the fit object).
extract_K(object)
object | An object returned by |
---|
An integer with the number of hidden states K.
The extract_* family is the safest way to access the generated samples (filtered probability alpha, smoothed probability gamma, most likely hidden path zstar, observation samples from the posterior predictive density ypred, hidden path samples from the posterior predictive density zpred, simulated observations ysim), the fixed pre-specified quantities (observations y, time series length T, number of hidden states K, dimension of the observation vector R), Markov-chain Monte Carlo specific information (convergence and posterior predictive diagnostics diagnostics, number of chains n_chains, total iterations n_iterations, warm-up iterations n_warmup, thinning n_thin, sample size sample_size), and other internal elements stored in a fit object (Specification
object spec, dataset in list format data, date date, time elapsed for fitting time, seed seed, path to the underlying Stan file filename). Except for MCMC-specific functions, these all work interchangeably with both Markov-chain Monte Carlo samples returned by draw_samples
and maximum a posteriori estimates returned by optimizing
.
This function does not allow the arguments combine, reduce, and chain.