PCR_ensemble_selection {ldsr} | R Documentation |
Select the best reconstruction
Description
Select the best reconstruction from an ensemble. Experimental, API may change.
Usage
PCR_ensemble_selection(
Qa,
pc,
start.year,
transform = "log",
Z = NULL,
agg.type = c("best member", "best overall"),
criterion = c("RE", "CE", "nRMSE", "KGE"),
return.all.metrics = FALSE
)
Arguments
Qa |
Observations: a data.frame of annual streamflow with at least two columns: year and Qa. |
pc |
For a single model: a data.frame, one column for each principal component. For an ensemble reconstruction: a list, each element is a data.frame of principal components. |
start.year |
Starting year of the climate proxies, i.e, the first year of the paleo period. |
transform |
Flow transformation, either "log", "boxcox" or "none". Note that if the Box-Cox transform is used, the confidence interval after back-transformation is simply the back-transform of the trained onfidence interval; this is hackish and not entirely accurate. |
Z |
A list of cross-validation folds. If |
agg.type |
Type of ensemble aggregate. There are 2 options: 'best member': the member with the best performance score is used; 'best overall': if the ensemble average is better than the best member, it will be used, otherwise the best member will be used. |
criterion |
The performance criterion to be used. |
return.all.metrics |
Logical, if TRUE, all members' performance scores (and the ensemble average's score, if |
Value
A list of two elements:
choice: The index of the selection. If the ensemble is selected, returns 0.
cv: the cross-validation results of the choice, see cvPCR for details.
all.metrics: all members' scores, and if
agg.type == 'best overall'
, the ensemble average's scores as well, in the last column.
Examples
PCR_ensemble_selection(NPannual, list(NPpc, NPpc[, 1:2]), start.year = 1200,
agg.type = 'best overall', criterion = 'KGE')
PCR_ensemble_selection(NPannual, list(NPpc, NPpc[, 1:2]), start.year = 1200,
agg.type = 'best overall', criterion = 'KGE')