Open finnlindgren opened 2 years ago
In addition, a linear = TRUE/FALSE
option should be added, to help in more general cases like sum(Amatrix %*% nameA.latent)
, and also to aid debugging.
Potentially useful: http://adv-r.had.co.nz/Expressions.html#ast-funs
When specifying a formula explicitly (i.e. with components separately defined), the only way to tell inlabru it's a linear predictor is currently to use
response ~ .
, and to useinclude
/exclude
to specify which components to include or exclude, either in multilikelihood models withlike()
or ingenerate()
/predict()
calls, to avoid attempts to evaluate undefined components. Would be useful to add a method that parses the formula and detects simplenameA + nameB
predictors, and also other more complex linear predictors, such asnameA - nameB
andnameA + nameB.latent
( withallow_latent=TRUE
and/orallow_combine=TRUE
). More complex expressions likenameA + Amatrix %*% nameB.latent
may also be possible to detect. The verbose output should also state the result (and ideally the reasoning) of this detection.