Description Usage Arguments Value References Examples
View source: R/define_interaction.R
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.
1 | control.interaction(m1, m2, interaction.type = 4)
|
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) |
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.
Knorr-Held, L. (2000). Bayesian modelling of inseparable space-time variation in disease risk. Statistics in Medicine, 19(1718):2555–2567.
1 2 | control.interaction(m(1:10, igmrf.type='rw1'),
m(1:20, igmrf.type='rw1'), interaction.type = 4)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.