Description Usage Arguments Details Value Author(s)
Calculates a Markov Chain of a probability distribution of a vector of continuous random variables, using the Metropolis algorithm with a normal jump distribution with given standard deviations and correlation structure.
1 2 | Markovchain.Metropolis(log.pdf,z.ini,prop.sd,prop.cor=0,
sampsize,thin=1,...)
|
log.pdf |
function |
z.ini |
vector of values at which the chain is to be started |
prop.sd |
vector of standard deviations of the proposal distribution |
prop.cor |
correlation matrix of proposal distribution, or NA if all correlations are zero |
sampsize |
sample size (length of the chain) |
thin |
factor with which to thin storage of results (thin=n: only each nth result is returned; this saves memory) |
... |
additional parameters passed to |
The log of the probability density of the distribution must be specified as a function log.pdf(z,...)
, where z
is the vector of values for which the density should be evaluated.
Returns a list containing:
z |
sample as a matrix, with sample points in rows |
log.pdf |
vector with log pdf values of the sample |
reject.freq |
rejection frequency of the jumps |
error |
error message (empty string if no error occurred) |
Peter Reichert <peter.reichert@eawag.ch>
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.