Last chance! 50% off unlimited learning
Sale ends in
The Rosenblatt transform takes data generated from a model and turns it into independent uniform variates, The inverse Rosenblatt transform computes conditional quantiles and can be used simulate from a stochastic model, see Details.
rosenblatt(x, model, cores = 1, randomize_discrete = TRUE)inverse_rosenblatt(u, model, cores = 1)
matrix of evaluation points; must be in
a model object; classes currently supported are
bicop_dist()
, vinecop_dist()
, and vine_dist()
.
if >1
, computation is parallelized over cores
batches (rows
of u
).
Whether to randomize the transform for discrete variables; see Details.
matrix of evaluation points; must be in
The Rosenblatt transform (Rosenblatt, 1952)
The formulas above assume a vine copula model with order rosenblatt()
returns the variables
inverse_rosenblatt()
returns
If some variables have atoms, Brockwell (10.1016/j.spl.2007.02.008) proposed
a simple randomization scheme to ensure that output is still independent
uniform if the model is correct. The transformation reads
randomize_discrete = FALSE
.
# simulate data with some dependence
x <- replicate(3, rnorm(200))
x[, 2:3] <- x[, 2:3] + x[, 1]
pairs(x)
# estimate a vine distribution model
fit <- vine(x, copula_controls = list(family_set = "par"))
# transform into independent uniforms
u <- rosenblatt(x, fit)
pairs(u)
# inversion
pairs(inverse_rosenblatt(u, fit))
# works similarly for vinecop models
vc <- fit$copula
rosenblatt(pseudo_obs(x), vc)
Run the code above in your browser using DataLab