ramps.control {ramps}R Documentation

Auxiliary for Controlling georamps Model Fitting

Description

Auxiliary function that provides a user interface to control the georamps model fitting algorithm.

Usage

   ramps.control(iter = 1000, beta, sigma2.e, phi, sigma2.z, sigma2.re,
                 z.monitor = TRUE, mpdfun = c("mpdbeta", "mpdbetaz"), file)

Arguments

iter

numerical value indicating the number of consecutive MCMC samples to generate, or a vector indicating specific iterations to monitor.

beta

'param' object of initial values and hyperparameters for the main effects coefficients. Flat priors are currently supported for these parameters. Argument is optional if no main effects appear in the model.

sigma2.e

'param' object of initial values and hyperparameters for the measurement error variances. Inverse-gamma priors are currently supported. Argument is optional if no measurement error variances appear in the model.

phi

'param' object of initial values and hyperparameters for the spatial correlation parameters. Uniform and user-defined priors are currently supported. Argument is optional if no correlation parameters appear in the model.

sigma2.z

'param' object of initial values and hyperparameters for the spatial variances. Inverse-gamma priors are currently supported. Argument is optional if no spatial variances appear in the model.

sigma2.re

'param' object of initial values and hyperparameters for the random effects variances. Inverse-gamma priors are currently supported. Argument is optional if no random effects appear in the model.

z.monitor

logical value indicating whether to monitor the latent spatial parameters, or data frame containing a subset of the coordinates at which to monitor the parameters.

mpdfun

character string giving the type of marginalized posterior density used for slice sampling and calculation of the data likelihood. Default is marginalization with respect to the beta parameters "mpdbeta", and the alternative is with respect to both the beta and z parameters "mpdbetaz". The latter may provide faster MCMC sampling when analyzing data with multiple observation per measurement site. The two options generate samples from the same posterior distribution.

file

vector or list of character strings specifying external files to which to save monitored parameters. Elements of the object named “params” and “z” will be taken to be the output files for model parameters and latent parameters, respectively. If these element names are not supplied, then the first element is taken to be the “params” output file and the second the “z” output file. Defaults to no external outputting of monitored parameters.

Details

Tuning parameters may be set for the sigma2 and phi arguments via the param function. If a user-defined prior is specified, then tuning parameters must be supplied and are taken to be the initial widths of the slice sampling windows. Otherwise, tuning parameters are taken to be factors by which the initial widths are multiplied. Separate tuning parameters may be set for each of the arguments. However, only the minimum of all sigma2 tuning parameters is used in the sampling of those parameters.

Value

A list containing the following components:

iter

sorted numerical vector of unique MCMC iterations to be monitored.

beta

'param' object of initial values for the main effects coefficients.

sigma2.e

'param' object of initial values for the measurement error variances.

phi

'param' object of initial values for the spatial correlation parameters.

sigma2.z

'param' object of initial values for the spatial variances.

sigma2.re

'param' object of initial values for the random effects variances.

z

list with element: monitor containing a logical monitoring indicator for the latent spatial parameters or a data frame of coordinates at which to monitor the parameters.

mpdfun

character string specifying the marginalized posterior distribution.

file

list with elements: params and z character strings specifying external files to which to save monitored model and spatial parameters.

expand

non-negative integer value indicating the starting point of the MCMC sampler, initialized to zero.

Author(s)

Brian Smith brian-j-smith@uiowa.edu

See Also

georamps, param

Examples

ctrl <- ramps.control(
   iter = seq(1, 100, by = 2),
   beta = param(rep(0, 2), "flat"),
   sigma2.e = param(rep(1, 2), "invgamma", shape = 2.0, scale = 0.1),
   phi = param(10, "uniform", min = 0, max = 100, tuning = 0.5),
   sigma2.z = param(1, "invgamma", shape = 2.0, scale = 0.1),
   file = c("params.txt", "z.txt")
)

[Package ramps version 0.6.18 Index]