Replies: 1 comment
-
I don't think the MatrixModels code there will work as intended, as it doesn't know what to do with the function calls, and this is likely causing the error. To allow this kind of behaviour for point process models, we'd have to add some kind of pre-processing "hook"; this is vaguely planned as a future feature, but isn't yet available. But for basic interaction terms (which doesn't necessarily make sense for continuous covariates; one should investigate whether the perceived need for a covariate product is a side-effect of non-linear effects of the individual covariates as well!) it's easy to construct the product values explicitly, and/or to use the comp <- ~ ... + elev_slop(f.elev(.data.) * f.slop(.data.), model = "const") + elev_slop_coef(1)
formula <- ... ~ ... + elev_slop * elev_slop_coef Alternatively, to keep the interaction effect as a thing, do comp <- ~ ... + elev_slop(1, weights = f.elev(.data.) * f.slop(.data.), model = "linear")
formula <- ... ~ ... + elev_slop and include the "main effects" as before, with The "interaction" formula notation is only a shortcut that obscures what is really used in the model; specifying it explicitly as above is safer, as it leaves no doubt what actually goes into the estimation. I would only use the shortcut notation for basic models with predefined fixed effects covariates and no point process observations. |
Beta Was this translation helpful? Give feedback.
-
Dear Finn,
This time I'm bringing a different issue but still related with the data analysis from #240. For the same data, I would like to include an interaction term to the point process model. I am using a joint point process model with detectability, and the point (group) size as a mark. The interaction term I'm interested in is between two continuous environmental covariates. Below you can find the code for the type of model I would like to fit:
I am not sure about how to specify the interaction but adapted based on this (https://cran.r-project.org/web/packages/inlabru/vignettes/component.html) vignette. However, the model doesn’t fit, it issues the following error message:
After
verbose = TRUE
Can you help me understand how to correctly specify the interaction term, or might it be related with something else?
Thank you for your attention,
Iúri J. F. Correia
Beta Was this translation helpful? Give feedback.
All reactions