IRIS Toolbox Reference Manual

arwm

Adaptive random-walk Metropolis posterior simulator

Syntax

[Theta,LogPost,ArVec,PosUpd] = arwm(Pos,NDraw,...)
[Theta,LogPost,ArVec,PosUpd,SgmVec,FinalCov] = arwm(Pos,NDraw,...)

Input arguments

Output arguments

Options

Description

The function poster/arwm returns the simulated chain of parameters and the corresponding value of the log posterior density. To obtain simulated sample statistics for each parameter (such as posterior mean, median, percentiles, etc.) use the function poster/stats to process the simulated chain and calculate the statistics.

The properties of the posterior object returned as the 4th output argument are updated so that they capture the final state of the posterior simulations. This can be used to initialize a next simulation at the point where the previous ended.

Parallelised ARWM

Set 'nStep=' greater than 1, and 'firstPrefetch=' smaller than NDraw to start a pre-fetching parallelised algorithm (pre-fetched will be all draws starting from 'firstPrefetch='); to that end, a pool of parallel workers (using e.g. matlabpool from the Parallel Computing Toolbox) must be opened before calling arwm.

With pre-fetching, all possible paths 'nStep=' steps ahead (i.e. all possible combinations of reject/accept) are pre-evaluated in parallel, and then the resulting path is selected. Adapation then occurs only every 'nStep=' steps, and hence the results will always somewhat differ from a serial run. Identical results can be obtained by turning down adaptation before pre-fetching starts, i.e. by setting 'lastAdapt=' smaller than 'firstPrefetch=' (and, obviously, by re-setting the random number generator).

References

Example