R: Initial Values

as.initial.values {LaplacesDemon} | R Documentation

## Initial Values

### Description

This function returns the most recent posterior samples from an object of class `demonoid` or `demonoid.hpc`, the posterior means of an object of class `iterquad`, the posterior modes of an object of class `laplace` or `vb`, the posterior means of an object of class `pmc` with one mixture component, or the latest means of the importance sampling distribution of an object of class `pmc` with multiple mixture components. The returned values are intended to be the initial values for future updates.

### Usage

    as.initial.values(x)

### Arguments

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

### Details

Unless it is known beforehand how many iterations are required for `IterativeQuadrature`, `LaplaceApproximation`, or `VariationalBayes` to converge, MCMC in `LaplacesDemon` 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 initial values as the original update, because it will have to repeat the work already accomplished. For this reason, the `as.initial.values` function may be used at the end of an update to change the previous initial values to the latest values.

When using `LaplacesDemon.hpc`, `as.initial.values` should be used when the output is of class `demonoid.hpc`, before the `Combine` function is used to combine the multiple chains for use with `Consort` and other functions, because the `Combine` function returns an object of class `demonoid`, and the number of chains will become unknown. The `Consort` function may suggest using `as.initial.values`, but when applied to an object of class `demonoid`, it will return the latest values as if there were only one chain.

### Value

The returned value is a vector (or matrix in the case of an object of class `demonoid.hpc`, or `pmc` with multiple mixture components) of the latest values, which may now be used as initial values for a future update.

### Author(s)

Statisticat, LLC. software@bayesian-inference.com

### See Also

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

[Package LaplacesDemon version 16.1.1 Index]