| AR2D2 | R Documentation | 
Perform a multivariate (non stationary) bias correction.
Use Quantiles shuffle in calibration and projection period with CDFt
mvq[MVQuantilesShuffle] Class to transform dependance structure
bc_method[SBCK::] Bias correction method
bckwargs[list] List of arguments of bias correction
bcm_[SBCK::] Instancied bias correction method
reverse[bool] If we apply bc_method first and then shuffle, or reverse
new()Create a new AR2D2 object.
AR2D2$new( col_cond = base::c(1), lag_search = 1, lag_keep = 1, bc_method = SBCK::CDFt, shuffle = "quantile", reverse = FALSE, ... )
col_condConditionning colum
lag_searchNumber of lags to transform the dependence structure
lag_keepNumber of lags to keep
bc_methodBias correction method
shuffleShuffle method used, can be quantile or rank
reverseIf we apply bc_method first and then shuffle, or reverse
...Others named arguments passed to bc_method$new
A new 'AR2D2' object.
fit()Fit the bias correction method. If X1 is NULL, the method is considered as stationary
AR2D2$fit(Y0, X0, X1 = NULL)
Y0[matrix: n_samples * n_features] Observations in calibration
X0[matrix: n_samples * n_features] Model in calibration
X1[matrix: n_samples * n_features] Model in projection
NULL
predict()Predict the correction
AR2D2$predict(X1 = NULL, X0 = NULL)
X1[matrix: n_samples * n_features or NULL] Model in projection
X0[matrix: n_samples * n_features or NULL] Model in calibration
[matrix or list] Return the matrix of correction of X1 if X0 is NULL (and vice-versa), else return a list containing Z1 and Z0, the corrections of X1 and X0
clone()The objects of this class are cloneable with this method.
AR2D2$clone(deep = FALSE)
deepWhether to make a deep clone.
Vrac, M. et S. Thao (2020). “R2 D2 v2.0 : accounting for temporal dependences in multivariate bias correction via analogue rank resampling”. In : Geosci. Model Dev. 13.11, p. 5367-5387. doi :10.5194/gmd-13-5367-2020.
## Three 4-variate random variables
Y0 = matrix( stats::rnorm( n = 1000 ) , ncol = 4 ) ## Biased in calibration period
X0 = matrix( stats::rnorm( n = 1000 ) , ncol = 4 ) / 2 + 3 ## Reference in calibration period
X1 = matrix( stats::rnorm( n = 1000 ) , ncol = 4 ) * 2 + 6 ## Biased in projection period
## Bias correction
cond_col = base::c(2,4)
lag_search = 6
lag_keep = 3
## Step 1 : construction of the class AR2D2 
ar2d2 = SBCK::AR2D2$new( cond_col , lag_search , lag_keep ) 
## Step 2 : Fit the bias correction model
ar2d2$fit( Y0 , X0 , X1 )
## Step 3 : perform the bias correction
Z = ar2d2$predict(X1,X0) 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.