mc {makemyprior}R Documentation

Define latent component

Description

Function for defining a latent component for the HD prior package. All model components must be specified, and if an HD prior is used, this is specified later. See make_prior for more details and examples.

Usage

mc(
  label,
  model = "iid",
  constr = NULL,
  lin_constr = FALSE,
  Cmatrix = NULL,
  graph = NULL,
  ...
)

Arguments

label

Name of the component (short names is an advantage as they are used in the app), no default (MUST be provided)

model

Type of model, default is "iid" (see list of models: makemyprior_models, makemyprior_models("latent")).

constr

Sum-to-zero constraints on component (default TRUE)

lin_constr

Linear sum-to-zero constraint, TRUE/FALSE (only for rw2 and only for Stan)

Cmatrix

Precision for this component when model = "generic0". We recommend that the matrixes are scaled to the typical variance of the corresponding covariance matrix is 1. This can be done with scale_precmat before sending matrix to mc.

graph

Path to graph file for besag effect (see details).

...

Additional arguments used for inference. For inference with rstan or inla, the following is useful (especially for the Besag model):

scale.model

if TRUE, the models are scaled so the geometric mean of the variance (typical variance) is 1

And some additional arguments that can be used by inla. Useful arguments include:

rankdef

number defining rank deficiency of the model

extraconstr

extra linear constraints (in addition to constr)

See f for details.

Details

The graph argument is a path to a file describing neighbouring relationship on the following form: First row: number of elements The rest: First number is the index of this element, second is the number of neighbours, the rest is the index numbers of all neighbours for this element. If element 1 and 4 are neighbours, 1 should have 4 in its neighbour list, and 4 should have 1.

Value

For specifying details on this latent component.

Examples

## Not run: 

vignette("make_prior", package = "makemyprior")

## End(Not run)


[Package makemyprior version 1.2.1 Index]