Learn R Programming

LaplacesDemon (version 16.1.1)

as.covar: Proposal Covariance

Description

This function returns the most recent covariance matrix or a list of blocking covariance matrices from an object of class demonoid, the most recent covariance matrix from iterquad, laplace, or vb, the most recent covariance matrix from the chain with the lowest deviance in an object of class demonoid.hpc, and a number of covariance matrices of an object of class pmc equal to the number of mixture components. The returned covariance matrix or matrices are intended to be the initial proposal covariance matrix or matrices for future updates. A variance vector from an object of class demonoid or demonoid.hpc is converted to a covariance matrix.

Usage

as.covar(x)

Arguments

x

This is an object of class demonoid, demonoid.hpc, iterquad, laplace, pmc, or vb.

Value

The returned value is a matrix (or array in the case of PMC with multiple mixture components) of the latest observed or proposal covariance, which may now be used as an initial proposal covariance matrix or matrices for a future update.

Details

Unless it is known beforehand how many iterations are required for iterative quadrature, Laplace Approximation, or Variational Bayes to converge, MCMC to appear converged, or the normalized perplexity to stabilize in PMC, multiple updates are necessary. An additional update, however, should not begin with the same proposal covariance matrix or matrices as the original update, because it will have to repeat the work already accomplished. For this reason, the as.covar function may be used at the end of an update to change the previous initial values to the latest values.

The as.covar function is most helpful with objects of class pmc that have multiple mixture components. For more information, see PMC.

See Also

IterativeQuadrature, LaplaceApproximation, LaplacesDemon, LaplacesDemon.hpc, PMC, and VariationalBayes.