control.interaction: Set up the interaction model

Description Usage Arguments Value References Examples

View source: R/define_interaction.R

Description

This function takes in input the main effects - defined through m() - and the type of interaction and defines the kronecker product IGMRF for the interaction and the associated constraints. Note; this function works under the assumption the data are sorted in a convenient manner, where both id.space and id.time contain increasing integers and id.time runs faster than id.space.

Usage

1
control.interaction(m1, m2, interaction.type = 4)

Arguments

m1

temporal main effect; it is the output of function m()

m2

spatial main effect; it is the output of function m()

interaction.type

a number from 1 to 4, indicating the interaction type as specified in Knorr-Held, L. (2000). The value 'none', which specifies the additive model, is experimental)

Value

A list of several objects, the most useful are 'Rkron' the structure matrix of the Kronecker product IGMRF for the interaction model, and 'constr' the constraints for the interaction random effects to pass on to inla.

References

Knorr-Held, L. (2000). Bayesian modelling of inseparable space-time variation in disease risk. Statistics in Medicine, 19(1718):2555–2567.

Examples

1
2
control.interaction(m(1:10, igmrf.type='rw1'),
m(1:20, igmrf.type='rw1'), interaction.type = 4)

massimoventrucci/inlaVP documentation built on Dec. 21, 2021, 2:51 p.m.