Learn R Programming

mcmcsae (version 0.6.0)

correlation: Correlation structures

Description

Element 'factor' of a model component is a formula composed of several possible terms described below. It is used to derive a (sparse) precision matrix for a set of coefficient, and possibly a matrix representing a set of linear constraints to be imposed on the coefficient vector.

iid(f)

Independent effects corresponding to the levels of factor f.

RW1(f, circular=FALSE)

First-order random walk.

RW2(f)

Second-order random walk.

AR1(f, phi)

First-order autoregressive correlation structure among the levels of f. Required argument phi (fixed number for now).

season(f, period)

Dummy seasonal with period period.

spatial(f, poly.df, snap, queen, derive.constraints=FALSE)

CAR spatial correlation. Argument poly.df should be an object of class SpatialPolygonsDataFrame obtained e.g. from reading in a shape file with readShapeSpatial from package maptools. Arguments snap and queen are passed to poly2nb. If derive.constraints=TRUE the constraint matrix for an IGMRF model component is formed by computing the singular vectors of the precision matrix.

custom(f, QD)

A custom precision or incidence matrix associated with factor f can be passed to argument QD.

Arguments