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, |
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 |
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):
And some additional arguments that can be used by inla. Useful arguments include:
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)