nonparboot-methods.Rd
Call nonparboot
on an unmarkedFit to obtain non-parametric
bootstrap samples. These can then be used by vcov
in order to
get bootstrap estimates of standard errors.
signature(object = "unmarkedFit")
Obtain nonparametric bootstrap samples for a general unmarkedFit.
signature(object = "unmarkedFitColExt")
Obtain nonparametric bootstrap samples for colext fits.
signature(object = "unmarkedFitDS")
Obtain nonparametric bootstrap samples for a distsamp fits.
signature(object = "unmarkedFitMPois")
Obtain nonparametric bootstrap samples for a distsamp fits.
signature(object = "unmarkedFitOccu")
Obtain nonparametric bootstrap samples for a occu fits.
signature(object = "unmarkedFitOccuPEN")
Obtain nonparametric bootstrap samples for an occuPEN fit.
signature(object = "unmarkedFitOccuPEN_CV")
Obtain nonparametric bootstrap samples for occuPEN_CV fit.
signature(object = "unmarkedFitOccuRN")
Obtain nonparametric bootstrap samples for a occuRN fits.
signature(object = "unmarkedFitPCount")
Obtain nonparametric bootstrap samples for a pcount fits.
Calling nonparboot
on an unmarkedFit returns the original
unmarkedFit, with the bootstrap samples added on. Then subsequent
calls to vcov
with the argument
method="nonparboot"
will use these bootstrap samples.
Additionally, standard errors of derived estimates from either
linearComb
or backTransform
can be
instructed to use bootstrap samples by providing the argument
method = "nonparboot"
.
For occu
and occuRN
both sites and
occassions are re-sampled. For all other fitting functions, only sites
are re-sampled.
data(ovendata)
ovenFrame <- unmarkedFrameMPois(ovendata.list$data,
siteCovs=as.data.frame(scale(ovendata.list$covariates[,-1])), type = "removal")
(fm <- multinomPois(~ 1 ~ ufc + trba, ovenFrame))
#>
#> Call:
#> multinomPois(formula = ~1 ~ ufc + trba, data = ovenFrame)
#>
#> Abundance:
#> Estimate SE z P(>|z|)
#> (Intercept) 0.102 0.119 0.864 0.388
#> ufc 0.100 0.126 0.794 0.427
#> trba -0.171 0.135 -1.262 0.207
#>
#> Detection:
#> Estimate SE z P(>|z|)
#> 0.288 0.233 1.24 0.217
#>
#> AIC: 326.1387
fm <- nonparboot(fm, B = 20) # should use larger B in real life.
vcov(fm, method = "hessian")
#> lambda(Int) lambda(ufc) lambda(trba) p(Int)
#> lambda(Int) 0.014052472 -1.228179e-03 2.364962e-03 -4.323007e-03
#> lambda(ufc) -0.001228179 1.594197e-02 8.057614e-03 -3.200697e-11
#> lambda(trba) 0.002364962 8.057614e-03 1.831812e-02 -3.459628e-11
#> p(Int) -0.004323007 -3.200697e-11 -3.459628e-11 5.415986e-02
vcov(fm, method = "nonparboot")
#> lambda(Int) lambda(ufc) lambda(trba) p(Int)
#> lambda(Int) 0.028845631 -0.001084086 0.0049178635 -0.0157796398
#> lambda(ufc) -0.001084086 0.013770757 0.0110038361 -0.0046697094
#> lambda(trba) 0.004917864 0.011003836 0.0186061311 0.0009194527
#> p(Int) -0.015779640 -0.004669709 0.0009194527 0.0948140633
avg.abundance <- backTransform(linearComb(fm, type = "state", coefficients = c(1, 0, 0)))
## Bootstrap sample information propagates through to derived quantities.
vcov(avg.abundance, method = "hessian")
#> [,1]
#> [1,] 0.01724521
vcov(avg.abundance, method = "nonparboot")
#> [,1]
#> [1,] 0.03539939
SE(avg.abundance, method = "nonparboot")
#> [1] 0.1881473