PCR_reconstruction {ldsr} | R Documentation |
Principal Component Regression Reconstruction
Description
Reconstruction with principal component linear regression.
Usage
PCR_reconstruction(Qa, pc, start.year, transform = "log")
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. |
Value
A list of reconstruction results, with the following elements:
For a single-model reconstruction:
rec: reconstructed streamflow with 95% prediction interval; a data.table with four columns: year, Q, Ql (lower bound), and Qu (upper bound).
coeffs: the regression coefficients.
sigma: the residual standard deviation.
For an ensemble reconstruction:
rec: the ensemble average reconstruction; a data.table with two columns: year and Q.
ensemble: a list of ensemble members, each element is reconstructed from one element of
pc
and is itself a list of three elements: Q (a vector of reconstructed flow), coeffs and sigma. Note that for ensemble reconstruction,ldsr
does not provide uncertainty estimates. It is up to the user to do so, for example, using ensemble spread.
Examples
PCR_reconstruction(NPannual, NPpc, start.year = 1200)