Bootstrapping function without model selection for a model of class 'gamMRSea' and beta family
Source:R/do.bootstrap.cress.robust.beta.r
do.bootstrap.cress.robust.beta.RdThis fuction performs a specified number of bootstrapping iterations using CReSS/SALSA for fitting the count model. See below for details.
Usage
do.bootstrap.cress.robust.beta(
model.obj,
predictionGrid,
splineParams = NULL,
g2k = NULL,
B,
robust = T,
name = NULL,
seed = 12345,
nCores = 1,
cat.message = TRUE
)Arguments
- model.obj
The best fitting
CReSSmodel for the original count data. Should be geeglm or a Poisson/Binomial GLM (not quasi).- predictionGrid
The prediction grid data
- splineParams
The object describing the parameters for fitting the one and two dimensional splines
- g2k
(N x k) matrix of distances between all prediction points (N) and all knot points (k)
- B
Number of bootstrap iterations
- name
Analysis name. Required to avoid overwriting previous bootstrap results. This name is added at the beginning of "predictionboot.RData" when saving bootstrap predictions.
- seed
Set the seed for the bootstrap sampling process.
- nCores
Set the number of computer cores for the bootstrap process to use (default = 1). The more cores the faster the proces but be wary of over using the cores on your computer. If
nCores> (number of computer cores - 2), the function defaults tonCores= (number of computer cores - 2). Note: On a Mac computer the parallel code does not compute so use nCores=1.- rename
A vector of column names for which a new column needs to be created for the bootstrapped data. This defaults to
segment.idfor line transects (which is required forcreate.bootcount.data), others might be added. A new column with new ids will automatically be created for the column listed inresample. In case of nearshore data, this argument is ignored.
Value
The function returns a matrix of bootstrap predictions. The number of rows is equal to the number of rows in predictionGrid. The number of columns is equal to B. The matrix may be very large and so is stored directly into the working directory as a workspace object: '"name"predictionboot.RObj'. The object inside is called bootPreds.