dsm.var.prop: Prediction variance propagation for DSMs

Description Usage Arguments Details Value Diagnostics Limitations Author(s) References Examples

View source: R/dsm.var.prop.R

Description

To ensure that uncertainty from the detection function is correctly propagated to the final variance estimate of abundance, this function uses a method first detailed in Williams et al (2011).

Usage

1
2
dsm.var.prop(dsm.obj, pred.data, off.set, seglen.varname = "Effort",
  type.pred = "response")

Arguments

dsm.obj

a model object returned from running dsm.

pred.data

either: a single prediction grid or list of prediction grids. Each grid should be a data.frame with the same columns as the original data.

off.set

a a vector or list of vectors with as many elements as there are in pred.data. Each vector is as long as the number of rows in the corresponding element of pred.data. These give the area associated with each prediction cell. If a single number is supplied it will be replicated for the length of pred.data.

seglen.varname

name for the column which holds the segment length (default value "Effort").

type.pred

should the predictions be on the "response" or "link" scale? (default "response").

Details

The idea is to refit the spatial model but including an extra random effect. This random effect has zero mean and hence to effect on point estimates. Its variance is the Hessian of the detection function. Variance estimates then incorporate detection function uncertainty. Further mathematical details are given in the paper in the references below.

Many prediction grids can be supplied by supplying a list of data.frames to the function.

Note that this routine simply calls dsm_varprop. If you don't require multiple prediction grids, the other routine will probably be faster.

Value

a list with elements

model the fitted model object
pred.var variance of each region given in pred.data.
bootstrap logical, always FALSE
pred.data as above
off.set as above
model the fitted model with the extra term
dsm.object the original model, as above
model.check simple check of subtracting the coefficients of the two models to see if there is a large difference
deriv numerically calculated Hessian of the offset

Diagnostics

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 covariates used in the detection function. If there are large differences between the probabilities of detection then there are potentially problems with the fitted model, the variance propagation or both. This can be because the fitted model does not account for enough of the variability in the data and in refitting the variance model accounts for this in the random effect.

Limitations

Note that this routine is only useful if a detection function has been used in the DSM. It cannot be used when the Nhat, abundance.est responses are used. 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).

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.

Author(s)

Mark V. Bravington, Sharon L. Hedley. Bugs added by David L. Miller.

References

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.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
## Not run: 
 library(Distance)
 library(dsm)

 # load the Gulf of Mexico dolphin data (see ?mexdolphins)
 data(mexdolphins)

 # fit a detection function
 df <- ds(distdata, max(distdata$distance),
          key = "hn", adjustment = NULL)

 # fit a simple smooth of x and y
 mod1 <- dsm(count~s(x, y), df, segdata, obsdata, family=tw())

 # Calculate the variance
 # this will give a summary over the whole area in mexdolphins$preddata
 mod1.var <- dsm.var.prop(mod1, preddata, off.set=preddata$area)
 summary(mod1.var)

## End(Not run)

dsm documentation built on July 4, 2017, 9:02 a.m.