Learn R Programming

rvinecopulib (version 0.3.2.1.1)

vinecop_distributions: Vine copula distributions

Description

Density, distribution function and random generation for the vine copula distribution.

Usage

dvinecop(u, vinecop, cores = 1)

pvinecop(u, vinecop, n_mc = 10^4, cores = 1)

rvinecop(n, vinecop, qrng = FALSE, cores = 1)

Arguments

u

evaluation points, either a length d vector or a d-column matrix, where d is the number of variables in the vine.

vinecop

an object of class "vinecop_dist".

cores

number of cores to use; if larger than one, computations are done in parallel on cores batches .

n_mc

number of samples used for quasi Monte Carlo integration.

n

number of observations.

qrng

if TRUE, generates quasi-random numbers using the multivariate Generalized Halton sequence up to dimension 300 and the Generalized Sobol sequence in higher dimensions (default qrng = FALSE).

Value

dvinecop() gives the density, pvinecop() gives the distribution function, and rvinecop() generates random deviates.

The length of the result is determined by n for rvinecop(), and the number of rows in u for the other functions.

The vinecop object is recycled to the length of the result.

Details

See vinecop for the estimation and construction of vine copula models. Here, the density, distribution function and random generation for the vine copulas are standard.

Examples

Run this code
# NOT RUN {
# specify pair-copulas
bicop <- bicop_dist("bb1", 90, c(3, 2))
pcs <- list(
  list(bicop, bicop), # pair-copulas in first tree
  list(bicop) # pair-copulas in second tree
)

# specify R-vine matrix
mat <- matrix(c(1, 2, 3, 1, 2, 0, 1, 0, 0), 3, 3)

# set up vine copula model
vc <- vinecop_dist(pcs, mat)

# simulate from the model
u <- rvinecop(200, vc)
pairs(u)

# evaluate the density and cdf
dvinecop(u[1, ], vc)
pvinecop(u[1, ], vc)
# }

Run the code above in your browser using DataLab