Hi all,
I’m fitting a simple spatial model using the dsm() function in R and encountering persistently distorted results, even though the input data appears clean and complete.
Context:
I'm modeling aerial survey data for an animal species using dsm(count ~ s(x, y), ...) with method = "REML".
The detection function is a standard hazard-rate model (ds(..., key = "hr", adjustment = NULL)), which fits well and shows no obvious issues.
My segment data (mysegdata) includes:
Effort (line length) in kilometers,
Coordinates (X, Y) in EPSG:3310 (California Albers),
Covariates such as elevation and vegetation metrics(though I haven't even gotten to modeling covariates yet).
Observation data includes ~170 detections with all required fields (object, Sample.Label, distance, size, etc.).
The prediction grid uses 500m x 500m cells, with matching CRS and reasonable covariate values.
Issue:
Even with a basic model like this:
the output is clearly off:
Linear predictor values are heavily skewed (e.g., from –3000 to 0),
Residuals are tightly clustered around zero,
Spatial prediction surfaces are nonsensical.
I’ve confirmed that:
There are no missing or extreme values in effort or covariates,
Coordinate and projection systems are consistent across all inputs (,
Observation and segment tables are correctly linked.
Would appreciate any guidance on what might be going wrong or where else to look.
I've also attached a plot of my transect segment midpoints, my observations, and my prediction grid. Everything looks good when I plot, but then when I try to use predict (and vis.gam()), the output is distorted (output also attached).
Thanks very much,
Brian