PPPSSR {SBCK} | R Documentation |
PPPSSR
Description
Apply the SSR transformation.
Details
Apply the SSR transformation. The SSR transformation replace the 0 by a random values between 0 and the minimal non zero value (the threshold). The inverse transform replace all values lower than the threshold by 0. The threshold used for inverse transform is given by the keyword 'isaved', which takes the value 'Y0' (reference in calibration period), or 'X0' (biased in calibration period), or 'X1' (biased in projection period)
Super class
SBCK::PrePostProcessing
-> PPPSSR
Public fields
Xn
[vector] Threshold
Methods
Public methods
Inherited methods
Method new()
Create a new PPPSSR object.
Usage
PPPSSR$new(cols = NULL, isaved = "Y0", ...)
Arguments
cols
Columns to apply the SSR
isaved
Choose the threshold used for the inverse transform. Can be "Y0", "X0" and "X1".
...
Others arguments are passed to PrePostProcessing
Returns
A new 'PPPSSR' object.
Method transform()
Apply the SSR transform, i.e. all 0 are replaced by random values between 0 (excluded) and the minimal non zero value.
Usage
PPPSSR$transform(X)
Arguments
X
Data to transform
Returns
Xt a transformed matrix
Method itransform()
Apply the inverse SSR transform, i.e. all values lower than the threshold found in the transform function are replaced by 0.
Usage
PPPSSR$itransform(Xt)
Arguments
Xt
Data to transform
Returns
X a transformed matrix
Method clone()
The objects of this class are cloneable with this method.
Usage
PPPSSR$clone(deep = FALSE)
Arguments
deep
Whether to make a deep clone.
Examples
## Start with data
XY = SBCK::dataset_like_tas_pr(2000)
X0 = XY$X0
X1 = XY$X1
Y0 = XY$Y0
## Define the PPP method
ppp = PPPSSR$new( bc_method = CDFt , cols = 2 )
## And now the correction
## Bias correction
ppp$fit(Y0,X0,X1)
Z = ppp$predict(X1,X0)