Learn R Programming

glmmBUGS (version 2.4.2)

restoreParams: Reparametrise bugs output

Description

Undoes the parametrisation used in writeBugsModel, and gives the original names to random effect levels.

Usage

restoreParams(bugsResult, ragged = NULL,extraX=NULL)

Arguments

bugsResult

Output from bugs, using a ragged array generated by winBugsRaggedArray and a model generated by writeBugsModel

ragged

The ragged array used to call bugs

extraX

Possible extra covariates for spatial regions with no data but do have predicted spatial effects.

Value

A list where each element is a matrix or an array. The first dimension is the number of realisations, the second the number of chains, and for vector-valued parameters and random effects, the third dimension is the length of the parameter.

If the model contains a spatial component, the result will have list entries the following:

Reffect

The random effect. In the case of spatial models this is the sum of the spatial and non-spatial random effects U+V.

,
ReffectSpatial

The spatial random effect for each region, if any

FittedReffect

The predicted values on the link scale, being the random effect plus intercept and effect of covariates.

See Also

bugs