Learn R Programming

ramps (version 0.6-12)

param: 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. NA elements will be replaced with random draws from the prior distribution when possible.
prior
character string specifying the prior distribution. This must be one of "flat", "invgamma", "normal", "uniform", or "user", with default "flat", and may be abbreviated to a uni
tuning
numerical tuning values the slice-simplex routine in the MCMC sampler.
...
hyperparameters of the specified prior distribution. See details below.

Value

  • A list of class 'param' containing the following components:
  • initnumerical vector of initial parameter values.
  • priorcharacter string specifying the prior distribution.
  • tuningnumerical vector of tuning values of length(init).
  • ...hyperparameters of the specified prior distribution.

Details

The supported prior distributions and associated hyperparameters are: [object Object],[object Object],[object Object],[object Object],[object Object] 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.

See Also

georamps, ramps.control

Examples

Run this code
## 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)

Run the code above in your browser using DataLab