param {ramps} | R Documentation |
Initialization of georamps Model Parameters
Description
Function used in conjunction with ramps.control
to specify the initial values and prior distributions used in calls to georamps
.
Usage
param(init, prior = c("flat", "invgamma", "normal", "uniform", "user"), tuning,
...)
Arguments
init |
numerical vector of initial parameter values. |
prior |
character string specifying the prior distribution. This must be one of |
tuning |
numerical tuning values the slice-simplex routine in the MCMC sampler. |
... |
hyperparameters of the specified prior distribution. See details below. |
Details
The supported prior distributions and associated hyperparameters are:
"flat"
Flat prior with no hyperparameters.
"invgamma"
Inverse-gamma with hyperparameters
shape > 0
andscale > 0
such thatf(x) = scale^{shape} / \Gamma(shape) x^{-shape - 1} \exp(-scale / x)
."normal"
Normal with hyperparameters
mean
andvariance
such thatf(x) = (2 \pi)^{-n/2} |\Sigma|^{-1/2} \exp(-1/2 (x - \mu)' \Sigma^{-1} (x - \mu))
. Thevariance
hyperparameter must be positive definite and may be supplied either as a vector (independence) or a matrix."uniform"
Uniform with hyperparameters
min
andmax > min
such thatf(x) = 1 / (max - min)
."user"
Use-defined function supplied as hyperparameter
f
which takes a single numeric vector of length and order equal to the associated model parameters and whose returns values are proportional to the prior distribution.
The number of model parameters to be initialized is determined by length(init)
. Missing values occurring in the supplied init
vector will be replaced with draws from the prior distribution, for all but the "flat"
specification.
Value
A list of class 'param'
containing the following components:
init |
numerical vector of initial parameter values. |
prior |
character string specifying the prior distribution. |
tuning |
numerical vector of tuning values of |
... |
hyperparameters of the specified prior distribution. |
Author(s)
Brian Smith brian-j-smith@uiowa.edu
See Also
Examples
## Initial values for a flat prior
param(rep(0, 2), "flat")
## Random generation of initial values for an inverse-gamma prior
param(rep(NA, 2), "invgamma", shape = 2.0, scale = 0.1)
## Independent normal priors
param(rep(0, 2), "normal", mean = c(0, 0), variance = c(100, 100))
## Correlated normal priors
npv <- rbind(c(100, 25), c(25, 100))
param(rep(0, 2), "normal", mean = c(0, 0), variance = npv)
## Uniform prior and MCMC tuning parameter specification
param(10, "uniform", min = 0, max = 100, tuning = 0.5)