Skip to content

how to define functions of covariates in lgcp #101

Discussion options

You must be logged in to vote

For full control over component inputs, you can use the full function call (if x and y are variable names in the input data, or the coordinate names):
cmp = ~ cov(my_cov(x, y), model = "linear")
The function must be vectorised, so that it returns the results for each x[i], y[i] pair.

This will cause inlabru to first evaluate the function call and store the result as a new internal variable. This is then used in the same way as if it had been part of the input data, so for regular models this doesn't really provide anything extra; you could just as well have created that variable before calling inlabru. But for LGCP models, this approach allows it to call your evaluator function based on n…

Replies: 4 comments 7 replies

Comment options

You must be logged in to vote
4 replies
@ASeatonSpatial
Comment options

@finnlindgren
Comment options

@finnlindgren
Comment options

@finnlindgren
Comment options

Answer selected by ASeatonSpatial
Comment options

You must be logged in to vote
2 replies
@finnlindgren
Comment options

@rita86ribeiro
Comment options

Comment options

You must be logged in to vote
1 reply
@finnlindgren
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants