rvinecopulib (version 0.5.5.1.1)

rosenblatt: (Inverse) Rosenblatt transform

Description

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.

Usage

rosenblatt(x, model, cores = 1)

inverse_rosenblatt(u, model, cores = 1)

Arguments

x

matrix of evaluation points; must be in \((0, 1)^d\) for copula models.

model

a model object; classes currently supported are bicop_dist(), vinecop_dist(), and vine_dist().

cores

if >1, computation is parallelized over cores batches (rows of u).

u

matrix of evaluation points; must be in \((0, 1)^d\).

Details

The Rosenblatt transform (Rosenblatt, 1952) \(U = T(V)\) of a random vector \(V = (V_1,\ldots,V_d) ~ F\) is defined as $$ U_1= F(V_1), U_{2} = F(V_{2}|V_1), \ldots, U_d =F(V_d|V_1,\ldots,V_{d-1}), $$ where \(F(v_k|v_1,\ldots,v_{k-1})\) is the conditional distribution of \(V_k\) given \(V_1 \ldots, V_{k-1}, k = 2,\ldots,d\). The vector \(U\) are then independent standard uniform variables. The inverse operation $$ V_1 = F^{-1}(U_1), V_{2} = F^{-1}(U_2|U_1), \ldots, V_d =F^{-1}(U_d|U_1,\ldots,U_{d-1}), $$ can be used to simulate from a distribution. For any copula \(F\), if \(U\) is a vector of independent random variables, \(V = T^{-1}(U)\) has distribution \(F\).

Examples

Run this code
# NOT RUN {
# 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 DataCamp Workspace