dsm_var_gam | R Documentation |
If one is willing to assume the the detection function and spatial model are independent, this function will produce estimates of variance of predictions of abundance, using the result that squared coefficients of variation will add.
dsm_var_gam( dsm.obj, pred.data, off.set, seglen.varname = "Effort", type.pred = "response" )
dsm.obj |
a model object fitted by |
pred.data |
either: a single prediction grid or list of prediction
grids. Each grid should be a |
off.set |
a a vector or list of vectors with as many elements as there
are in |
seglen.varname |
name for the column which holds the segment length
(default value |
type.pred |
should the predictions be on the "response" or "link"
scale? (default |
a list
with elements
model
the fitted model object
pred.var
variance of the regions given in pred.data
.
bootstrap
logical, always FALSE
model
the fitted model with the extra term
dsm.object
the original model (dsm.obj
above)
David L. Miller
## Not run: library(Distance) library(dsm) # load the Gulf of Mexico dolphin data (see ?mexdolphins) data(mexdolphins) # fit a detection function and look at the summary hr.model <- ds(distdata, truncation=6000, key = "hr", adjustment = NULL) summary(hr.model) # fit a simple smooth of x and y mod1 <- dsm(count~s(x, y), hr.model, segdata, obsdata) # Calculate the variance # this will give a summary over the whole area in mexdolphins$preddata mod1.var <- dsm_var_gam(mod1, preddata, off.set=preddata$area) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.