-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
1D spde for flexible covariates in PointedSDMs #21
Comments
Hi! Great to see you're using the package. The |
Hi Philip. Many thanks for your response - greatly appreciated! – that indeed helped me get a 1D SPDE model working for temperature. However, I got stuck trying to do the same for bathymetry and slope, which still appear as linear (fixed) effects in the model summary. However, I want to allow all my covariates to be flexible. Below is a quick recap of what I tried: 1. Start iSDM bathymetry slope 3. Update formula organizedData$updateFormula( organizedData$updateFormula( 4. Fit model 5. Summary $Fixed__Effects__Comps $temperature Many thanks again! |
Dear Philip,
I am working on data integration for SDMs where i want to model my PO data using a dynamic variable (temperature) and my PA data using static variables (bathymetry and slope).
Our current integrated model looks like this:
Integrated Model: PO (Temperature) + PA (Bathymetry & Slope)
organizedData <- startISDM(
data = list(po_sf, pa_sf), # Combine PO and PA data
Mesh = mesh,
Projection = proj_azores,
spatialCovariates = env_stack_bs_masked, # Bathymetry and slope for PA
pointCovariates = list("temperature", NULL), # Temperature for PO, no additional covariates for PA
Boundary = study_area_sf,
responseCounts = "counts", # Response for PO data
responsePA = "presence_absence", # Response for PA data
pointsSpatial = "copy", # Share spatial random field
Formulas = list(
covariateFormula = ~ bathymetry + slope, # Covariates for PA
pointCovariateFormula = ~ temperature Covariates for PO
)
)
modelRun_Int <- fitISDM(organizedData, options = list(
control.inla = list(strategy = "simplified.laplace", int.strategy = "eb"),
control.compute = list(return.marginals.predictor = TRUE)
))
summary(modelRun_Int)
and it works fine - also the dynamic predictions. As you see I pass the static variables as spatialCovariates and the temperature as pointCovariate for the PO data, since I have temperature values for multiple months and want to fit a "global" model that i can predict onto different months.
Now, need to extend this functionality to model the covariate effects flexibly. The motivation behind this is that I'm working with virtual species whose habitat suitability functions from the covariates are either Gaussian or logistic. To capture these non-linear relationships, I would like to build 1D SPDE models for the covariates. While I found some resources of people implementing this directly in inla, I would still like to stick with the PointedSDMs package since I really like working in this package.
My question to you is:
organizedData$updateFormula(
datasetName = 'po_sf', # PO dataset
newFormula = ~ f(temperature, model = spde_temp$spde) # 1D SPDE for temperature
)
(for all the covariates) always gave me the following error:
Error in isDiagonal(from) : unexpected type "list" in 'typeToKind'
I really appreciate your help with this - I am very new to this Package and modelling in INLA in general, so many thanks in advance!
Moritz
The text was updated successfully, but these errors were encountered: