Skip to content

Struggling to fit covariates with LGCP #199

Answered by finnlindgren
lvclarke asked this question in Q&A
Discussion options

You must be logged in to vote

Thanks! Does it run without the covariate component? The error trace seems to indicate it's having trouble identifying the possible values of the covariate. The main issue I think is that there is no eval_spatial.RasterLayer, so inlabru doesn't realise it would have needed to do spatial evaluaton of the covariate. Fortunately, the terra style of rasters are supported, so I think you can solve the issue by simply converting it before running the model. I'm guessing that your Covariates object is a full raster object, in which case you can probably do this:

Covariates <- terra::rast(Covariates)

Otherwise you'd need to convert the individual layer.
I don't think you need to change anything …

Replies: 2 comments 6 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
6 replies
@lvclarke
Comment options

@finnlindgren
Comment options

Answer selected by finnlindgren
@finnlindgren
Comment options

@lvclarke
Comment options

@finnlindgren
Comment options

@lvclarke
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants