Variance estimation via Bayesian results

Description

Use results from the Bayesian interpretation of the GAM to obtain uncertainty estimates. See Wood (2006).

Usage

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

Arguments

dsm.obj

an 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

This is based on dsm.var.prop taken from code by Mark Bravington and Sharon Hedley.

Value

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, as above

Author(s)

David L. Miller

Examples

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

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

 # fit a detection function and look at the summary
 hr.model <- ds(distdata, max(distdata$distance),
                key = "hr", adjustment = NULL)
 summary(hr.model)

 # fit a simple smooth of x and y
 mod1 <- dsm(N~s(x,y), hr.model, segdata, obsdata)

 # Calculate the variance
 mod1.var <- dsm.var.gam(mod1, preddata, off.set=preddata$area)

 # this will give a summary over the whole area in mexdolphins$preddata

# detach the data
detach("mexdolphins")

## End(Not run)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.