secrgam.fit: SECR fit with flexible Density models - beta version.

Description Usage Arguments Details Examples

Description

Fits GAM using regression splines for the density model. Does this by creating spline basis functions (which are stored as covariates in a mask object) and then calling function secr.fit to operate on these.

Usage

1
2
secrgam.fit(capthist, model = list(D ~ 1, g0 ~ 1, sigma ~ 1), mask = NULL,
  buffer = 100, sessioncov = NULL, ...)

Arguments

capthist

capture history, as for function secr.fit.

model

model list, as for function secr.fit, but allowing terms of the form s(var,k=df), s(var,...,k=df), te(var,...,k=df) where var is a mask coordinate (x or y) or a variable in attr(mask, "covariate"), “...” is a comma-separated list of other such variables, and df is the degrees of freedom of the spline basis (the number of knots).

mask,

as for function secr.fit

...

other arguments to secr.fit

Details

Returns an object of class c("secrgam","secr"), the latter being same class of object as is returned by secr.fit of package secr.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
## Not run: 
data(Boland.leopards1)
model = list(D ~ s(alt, k = 4), g0 ~ 1, sigma ~ 1)
fit = secrgam.fit_beta(capthist = Boland.CH1, model = model, mask = Boland.mask1, trace = FALSE)
fit # look at fit results

# plot fitted surface:
plot(fit, asp=1)
plot(traps(Boland.CH1), add = TRUE)

# plot smooths:
plot(fit, type = "smooth")

# get abundance and density estimates
region.ND(fit)

# session-level smooths
data(ovenbird)
ovenfit = secrgam.fit(ovenCH, model = D ~ s(Session,k=3), mask = ovenmask, trace = FALSE)
plot(ovenfit, type = "smooth")
region.ND(ovenfit)

## End(Not run)

david-borchers/secrgam documentation built on May 14, 2019, 9:30 p.m.