posterior | R Documentation |
Constructing MCMC samples of prior and posterior distibutions for the location (with optional trend), scale and shape parameters under the gev, order statistics or point process models.
posterior(n, init, prior, lh = c("none", "gev", "gpd", "pp","os"), ..., psd, burn = 0, thin = 1)
n |
The run-length; the number of sampled vectors
(excluding |
init |
Numeric vector of length three/four, giving the initial values for the chain, taken to be iteration zero. |
prior |
An object of class |
lh |
A character string specifying the likelihood; either
|
... |
Arguments to the likelihood. Should include |
psd |
A vector of length three/four containing standard deviations for proposal distributions. |
burn |
The burn-in period (an integer); the first |
thin |
The thinning interval (an integer); iteration k
is stored only if k mod |
See the user's guide.
A matrix with 1+floor(n/thin)-burn
rows.
Row labels give the iteration numbers.
Column labels give parameter names.
An attribute ar
is also returned.
This is a matrix containing acceptence rates in the first row
(the number of proposals accepted divided by the number of
iterations) and “external rates” in the second (the number of
proposals that resulted in a zero likelihood, divided by the
number of iterations).
pplik
, prior.prob
data(rainfall) prrain <- prior.quant(shape = c(38.9, 7.1, 47), scale = c(1.5, 6.3, 2.6)) n <- 100 ; t0 <- c(50.8, 1.18, 0.65) ; s <- c(25, .35, .07) ; b <- 20 rn.prior <- posterior(n, t0, prrain, "none", psd = s, burn = b) t0 <- c(43.2, 7.64, 0.32) ; s <- c(2, .2, .07) rn.post <- posterior(n, t0, prrain, "pp", data = rainfall, thresh = 40, noy = 54, psd = s, burn = b)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.