Bootstrap resampling for class "lmf"

Share:

Description

Generates bootstrap replicates of the estimated parameters in a "lmf" model. Ordinary bootstrap is performed for the projection matrix, while both parametric and ordinary (non-parametric) resampling is available for the remaining parameters in the model. In addition, bootstrapping under any choosen null hypothesis is available for hypothesis testing.

Usage

1
2
3
4
5
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)), ...)

Arguments

object

a fitted object of of class "lmf".

nboot

the number og bootstraps desired.

what

which set of parameters to bootstrap. Options are "projection" to only resample projection matrix, growth rate (λ), stable age distribution (u) and reproductive values (v). "alpha" to resample demographic and environmental variances as well as all the estimates selection parameters. "H0" to resample temporal coefficients of selection under a given null hypothesis (This options requires specification of the additional arguments 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).

asim

the type of bootstrap for the parameters other than the projection matrix (which is always ordinary bootstrapped). Options are "parametric" (default) and "ordinary".

sig.dj

logical, TRUE(default) to include uncertainty in the estimation of the demographic variance when bootstrapping alpha estimates.

H0exp

a list with the first element a vector containing the expected temproal mean coefficients of selection (alpha) and the second element a matrix containing the elements of the expected temporal variance-covariance matrix (M) under the null hypothesis. This argument needs to be specified to perform hypothesis testing.

H0con

the conditions under which the null hypothesis should be tested. Options are "fs" to assume fluctuating selection, "nfs" to assume no fluctuating selection, "ds" to assume directional selection and "nds" to assume no directional selection. "nds" is not implemented due to increased risk of Type I error if the assumption is not correct, but is included here for completeness.

method

defines what optimalization algorithm to be used in the maximization of the loglikelihood. Alternatives are: "Nelder-Mead", "BFGS" (default), "CG", "L-BFGS-B" and "SANN". Not all are applicable here. See ?optim for details.

control

a list of control parameters for the maximization of the likelihood. 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.

...

additional arguments to be passed to optim for the maximization of the loglikelihood. See ?optim for options.

Details

The resampling procedures preserve the observed ratios of the different age classes during resampling of the projection matrix.

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σ^2_{dj} and using the mean and variance from in the paper.

Value

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:

running.time

the total time used for computation.

optim.time

the time used for maximation of the loglikelihood.

call

the matched call.

asim

the value specified of asim.

nboot

the number of bootstrap replicates generated.

uage

the unique age classes in the data set.

nage

the number of unique age classes in the data set.

npar

the number of parameters in the model.

uyear

the unique years in the data set.

nyear

the number of unique years in the data set.

l

the estimated projection matrix.

lboot

the bootstrap replicates of the projection matrix.

lambda

the deterministic multiplicative growth rate of the population.

u

the stable age distribution.

v

the vector of reproductive values for each age class.

luvboot

the bootstrap replicates of λ, u and v.

sigma2.dj

a list containing the demographic variance for each age class. Sorted by age class.

djboot

the bootstrap replicates of sigma2.dj.

sigma2.d

the total demographic variance of the population.

dboot

the bootstrap replicates of sigma2.d.

Atboot

the bootstrap replicates of the yearly variance-covariance matrices. The unscaled variance-covariance matrices are kept constant, but each set of yearly estimates are scaled by the bootstrapped sigma2.dj.

atboot

the bootstrap replicates of the yearly coefficients of selection. This can be performed "parametric"(default) or "ordinary".

M

the estimated temporal covariance matrix (fluctuating selection).

aM

the estimated temporal mean coefficients of selection.

Mboot

the bootstrap replicates of M.

aMboot

the bootstrap replicates of aM.

atCboot

the bootstrap replicates of the best linear predictor for the estimated yearly coefficients of selection (i.e. corrected for sampling errors).

Anf

the estimated temporal covariance matrix assuming no fluctuating selection.

anf

the estimated temporal mean selection coefficients assuming no fluctuating selection.

Anfboot

the bootstrap replicates of Anf.

anfboot

the bootstrap replicates of anf.

sigma2.e

the environmental variance of the population.

eboot

the bootstrap replicates of sigma2.e.

eCboot

the bootstrap replicates of sigma2.eC.

H0aMboot

the bootstrap replicates of aM under the specified null hypothesis H0exp and the assumption of fluctuating selection (Hexp = "fs").

H0anfboot

the bootstrap replicates of anf under the specified null hypothesis H0exp and the assumption of no fluctuating selection (Hexp = "nfs").

H0atnfboot

the bootstrap replicates of at under the specified null hypothesis H0exp and the assumption of directional selection (Hexp = "ds"). These bootstrap replicates are used to generate H0Mnfboot.

H0Mnfboot

the bootstrap replicates of M under the specified null hypothesis H0exp and the assumption of directional selection (Hexp = "ds").

Author(s)

Thomas Kvalnes

References

Engen, S., Saether, B.-E., Kvalnes, T. and Jensen, H. 2012. Estimating fluctuating selection in age-structured populations. Journal of Evolutionary Biology, 25, 1487-1499.

See Also

lmf, ci.boot.lmf

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
#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)