inlabru-org / inlabru

inlabru
https://inlabru-org.github.io/inlabru/
76 stars 21 forks source link

Formula and matrix input feature to handle factor interactions #90

Closed finnlindgren closed 1 year ago

finnlindgren commented 3 years ago

Currently, users have to create their own dummy variables for complex factor model constructions. We can allow matrix input, and automated model.matrix call if the input expression returns a formula (like for Spatial covariate objects), and a mapper that handles the mapping to an iid model with fixed precision (like the `factor_models). Need some care to propagate the matrix column names, but can likely be done the same way as the existingfactor_*models. Use example: bru(~ theeffect(~ -1 + a+ b + a:b), ...)`