
Rescale future climate predictors using current model coefficients
Source:R/PredictiveProvenance.R
rescaleFuture.RdStandardises future predictors using the mean and SD from current climate,
then applies the glmnet beta weights. This is the same weighting applied
upstream in RescaleRasters — here we just do it against a different
raster stack.
Arguments
- model
glmnet model object from
elasticSDM_noPCNM()$Model.- future_predictors
SpatRaster of future climate variables. Names must match those retained in
model.- current_predictors
SpatRaster of current climate (provides the standardisation parameters).
- training_data
the same data that went into the glmnet model, this is used for calculating variance which is required for the scaling process. From
elasticSDM- pred_mat
the Prediction matrix from
elasticSDM