Description Usage Arguments Details Value Examples
description...
1 2 |
fit |
a fitted |
N |
average abundance (converts density surface to relative density) |
Dmodel |
density model formula |
Dpars |
associated parameters for the density model |
Dlink |
link function (default is "log") |
mask |
|
log |
if |
details...
value...
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 26 27 28 | data(Boland.leopards1)
data(Boland.fits1)
# use a fitted model
popn = sim.popn.secrgam(fit1.a3) ; head(popn) ; dim(popn)
plot(fit1.a3, type = "density", asp = 1)
points(popn, cex = 0.5, pch = 19)
# use an inflated density surface from a fitted model
popn = sim.popn.secrgam(fit1.a3, N = 1000) ; head(popn) ; dim(popn)
plot(fit1.a3, type = "density", asp = 1)
points(popn, cex = 0.5, pch = 19)
## Not run:
# use an alternative model
# e.g. construct a tensor product model to represent a bivariate normal
require(mvtnorm)
D = dmvnorm(Boland.mask1, apply(Boland.mask, 2, mean), 10e7 * diag(2)) * 10e6
N = sum(D) * attributes(Boland.mask)$area ; N # expected sample size
data = cbind(z = D, Boland.mask)
prep4image(data, key = FALSE, col = topo.colors(10), asp = 1)
model = D ~ te(x, y, k = 3)
fit = gam(model, gaussian(link = "log"), data, fx = TRUE)
prep4image(data.frame(x = data$x, y = data$y, z = fitted(fit)), key = FALSE, asp = 1)
popn = sim.popn.secrgam(Dmodel = model, Dpars = coef(fit), mask = Boland.mask1) ; head(popn) ; dim(popn)
points(popn, cex = 0.5, pch = 19)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.