dsm_var_gam {dsm} | R Documentation |
Prediction variance estimation assuming independence
Description
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.
Usage
dsm_var_gam(
dsm.obj,
pred.data,
off.set,
seglen.varname = "Effort",
type.pred = "response"
)
Arguments
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 |
Value
a list
with elements
-
model
the fitted model object -
pred.var
variance of the regions given inpred.data
. -
bootstrap
logical, alwaysFALSE
-
model
the fitted model with the extra term -
dsm.object
the original model (dsm.obj
above)
Author(s)
David L. Miller
Examples
## 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)