MVQuantilesShuffle: MVQuantilesShuffle

MVQuantilesShuffleR Documentation

MVQuantilesShuffle

Description

Multivariate Schaake shuffle using the quantiles.

Details

Used to reproduce the dependence structure of a dataset to another dataset

Public fields

col_cond

[vector] Conditionning columns

col_ucond

[vector] Un-conditionning columns

lag_search

[integer] Number of lags to transform the dependence structure

lag_keep

[integer] Number of lags to keep

n_features

[integer] Number of features (dimensions), internal

qY

[matrix] Quantile structure fitted, internal

bsYc

[matrix] Block search fitted, internal

Methods

Public methods


Method new()

Create a new MVQuantilesShuffle object.

Usage
MVQuantilesShuffle$new(col_cond = base::c(1), lag_search = 1, lag_keep = 1)
Arguments
col_cond

Conditionning colum

lag_search

Number of lags to transform the dependence structure

lag_keep

Number of lags to keep

Returns

A new 'MVQuantilesShuffle' object.


Method fit()

Fit method

Usage
MVQuantilesShuffle$fit(Y)
Arguments
Y

[vector] Dataset to infer the dependance structure

Returns

NULL


Method transform()

Transform method

Usage
MVQuantilesShuffle$transform(X)
Arguments
X

[vector] Dataset to match the dependance structure with the Y fitted

Returns

Z The X with the quantiles structure of Y


Method clone()

The objects of this class are cloneable with this method.

Usage
MVQuantilesShuffle$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

References

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.

Examples

## Generate sample
X = matrix( stats::rnorm( n = 100 ) , ncol = 4 )
Y = matrix( stats::rnorm( n = 100 ) , ncol = 4 )

## Fit dependence structure
## Assume that the link beween column 2 and 4 is correct, and change also
## the auto-correlation structure until lag 3 = lag_keep - 1
mvq = MVQuantilesShuffle$new( base::c(2,4) , lag_search = 6 , lag_keep = 4 )
mvq$fit(Y)
Z = mvq$transform(X)


SBCK documentation built on Sept. 11, 2023, 5:10 p.m.