boot.lmf(object, nboot = 1000, what = c("projection", "alpha", "H0", "all"), asim = c("ordinary", "parametric"), sig.dj = TRUE, H0exp = list(alpha = NULL, M = NULL), H0con = c("fs", "nfs", "ds", "nds"), method = c("BFGS"), control = list(maxit = 500, reltol = sqrt(.Machine$double.eps)), ...)H0exp and H0con). "all" (default) to resample all the
above mentioned parameters (also here H0exp and H0con must be
specified for hypothesis testing or only "projection" and "alpha" will
be resampled).
TRUE(default) to include uncertainty in the
estimation of the demographic variance when bootstrapping alpha estimates.
?optim for details.
maxit sets the maximum number of iterations to use before
convergence and reltol sets the relative threshold for improvement in
the likelihood which desides whether to continue maximation or end.
See ?optim for details.
?optim for options.
boot.lmf returns a object of class "boot.lmf".The function summary is used to obtain and
print a summary of the bootstrap replicates and to print results from tests of
hypotheses. For construction of confidene intervals for the parameters the
function ci.boot.lmf is used.An object of class "boot.lmf" is a list containing at most the following
components:
sigma2.dj.sigma2.d.sigma2.dj.M.aM.Anf.anf.sigma2.e.sigma2.eC.aM under the
specified null hypothesis H0exp and the assumption of fluctuating
selection (Hexp = "fs").anf under the
specified null hypothesis H0exp and the assumption of no fluctuating
selection (Hexp = "nfs").at under the
specified null hypothesis H0exp and the assumption of directional
selection (Hexp = "ds"). These bootstrap replicates are used to
generate H0Mnfboot.M under the
specified null hypothesis H0exp and the assumption of directional
selection (Hexp = "ds").Ordinary bootstrap will often be subject to bias due to few years of data in most available data sets within biology (generally << 40), thus the parametric bootstrap is recomended for most purposes.
The bootstrap procedure is closely associated with the method deployed in
lmf and further details can be found in Engen et al. 2012.
Different from Engen et al. 2012, the sigma2.dj is defined as independent gamma distributed variables with shape = $\frac{(EX)^2}{Var(X)}$ and rate = $\frac{EX}{Var(X)}$. Where X = $\hat\sigma^2_{dj}$ and using the mean and variance from in the paper.
lmf, ci.boot.lmf
#Data set from Engen et al. 2012
data(sparrowdata)
#Fit model
lmf.1 <- lmf(formula = cbind(recruits, survival) ~ weight + tars,
age = age, year = year, data = sparrowdata)
#Bootstrap parameters
b.1 <- boot.lmf(object = lmf.1, nboot = 10, sig.dj = TRUE,
what = "all", asim = "parametric")
#Print
b.1
#Summary
summary(b.1)
#View density plots
plot(b.1)
#Test of hypoteses
b.2 <- boot.lmf(object = lmf.1, nboot = 10, sig.dj = TRUE,
what = "H0", H0exp = list(rep(0, 3), matrix(0, ncol = 3, nrow = 3)),
asim = "parametric")
#Summary
summary(b.2)
Run the code above in your browser using DataLab