View source: R/paleocar_models.R
paleocar_models | R Documentation |
This is the primary function for fitting PaleoCAR models to a large set of predictands using
a uniform set of predictors (tree-ring chronologies). For each predictand, carscores
are calculated for
each predictor, and models are calculated by adding predictors stepwise to an ordinary least-squares
linear model using the lm
function. Model selection is performed by minimizing corrected AIC.
This occurs for every unique set of available predictors through time.
paleocar_models(
chronologies,
predictands,
calibration.years,
prediction.years = NULL,
min.width = NULL,
verbose = F,
...
)
chronologies |
A matrix of tree ring chronologies, indexed annually. Each chronology is a column. The first column must be labeled "YEAR" and is the calendar year. |
predictands |
A RasterBrick, RasterStack, matrix, or vector of the numeric predictand (response) variable. |
calibration.years |
An integer vector of years corresponding to the layers in the |
prediction.years |
An optional integer vector of years for the reconstruction.
If missing, defaults to the total years present in |
min.width |
integer, indicating the minimum number of tree-ring samples allowed for that year of a chronology to be valid. |
verbose |
Logical, display status messages during run. |
... |
Further arguments to be passed to other functions. |
See paleocar_models
for a simplified algorithm that fits a PaleoCAR model for
a single predictand. The batch algorithm gains efficiencies by minimizing the number of unique model calculations
(using multiple-response models) and by halting calculations for individual predictands once they
stabilize.
A named list containing
models
A data.table
giving the fitted coefficients, LOOCV errors, and AICc values through time for each predictand.
predictands
A vector, matrix, or RasterBrick of predictands, as provided.
predictor.matrix
A matrix of predictors for calibration; chronologies
cropped to calibration.years
.
reconstruction.matrix
A matrix of predictors for reconstruction; chronologies
cropped to prediction.years
, or all of chronologies
if prediction.years==NULL
.
carscores
A list of carscore matrices, one for each predictand.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.