Calculate the uncertainty in predictions from a fitted DSM, including uncertainty from the detection function.
dsm_varprop(model, newdata, trace = FALSE, var_type = "Vp")a fitted dsm
the prediction grid
for debugging, see how the scale parameter estimation is going
which variance-covariance matrix should be used ("Vp" for variance-covariance conditional on smoothing parameter(s), "Vc" for unconditional). See gamObject for an details/explanation. If in doubt, stick with the default, "Vp".
a list with elements
old_model |
fitted model supplied to the function as model |
refit |
refitted model object, with extra term |
pred |
point estimates of predictions at newdata |
var |
total variance calculated over all of newdata |
ses |
standard error for each prediction cell in newdata |
The summary output from the function includes a simply diagnostic that shows the average probability of detection from the "original" fitted model (the model supplied to this function; column Fitted.model) and the probability of detection from the refitted model (used for variance propagation; column Refitted.model) along with the standard error of the probability of detection from the fitted model (Fitted.model.se), at the unique values of any factor covariates used in the detection function (for continuous covariates the 5
When we make predictions from a spatial model, we also want to know the uncertainty about that abundance estimate. Since density surface models are 2 (or more) stage models, we need to incorporate the uncertainty from the earlier stages (i.e. the detection function) into our "final" uncertainty estimate.
This function will refit the spatial model but include the Hessian of the offset as an extra term. Variance estimates using this new model can then be used to calculate the variance of predicted abundance estimates which incorporate detection function uncertainty. Importantly this requires that if the detection function has covariates, then these do not vary within a segment (so, for example covariates like sex cannot be used).
For more information on how to construct the prediction grid data.frame, newdata, see predict.dsm.
This routine is only useful if a detection function with covariates has been used in the DSM.
Note that we can use var_type="Vc" here (see gamObject), which is the variance-covariance matrix for the spatial model, corrected for smoothing parameter uncertainty. See Wood, Pya & S\"afken (2016) for more information.
Negative binomial models fitted using the nb family will give strange results (overly big variance estimates due to scale parameter issues) so nb models are automatically refitted with negbin (with a warning). It is probably worth refitting these models with negbin manually (perhaps giving a smallish range of possible values for the negative binomial parameter) to check that convergence was reached.
Williams, R., Hedley, S.L., Branch, T.A., Bravington, M.V., Zerbini, A.N. and Findlay, K.P. (2011). Chilean Blue Whales as a Case Study to Illustrate Methods to Estimate Abundance and Evaluate Conservation Status of Rare Species. Conservation Biology 25(3), 526-535.
Wood, S.N., Pya, N. and S\"afken, B. (2016) Smoothing parameter and model selection for general smooth models. Journal of the American Statistical Association, 1-45.