| vine_distributions | R Documentation |
Density, distribution function and random generation for the vine based distribution.
dvine(x, vine, cores = 1)
pvine(x, vine, n_mc = 10^4, cores = 1)
rvine(n, vine, qrng = FALSE, cores = 1)
x |
evaluation points, either a length d vector or a d-column matrix, where d is the number of variables in the vine. |
vine |
an object of class |
cores |
number of cores to use; if larger than one, computations are
done in parallel on |
n_mc |
number of samples used for quasi Monte Carlo integration. |
n |
number of observations. |
qrng |
if |
See vine for the estimation and construction of vine models. Here, the density, distribution function and random generation for the vine distributions are standard.
The functions are based on dvinecop(), pvinecop() and rvinecop() for
vinecop objects, and either kde1d::dkde1d(), kde1d::pkde1d() and
kde1d::qkde1d() for estimated vines (i.e., output of vine()), or the
standard d/p/q-xxx from stats::Distributions for custom vines
(i.e., output of vine_dist()).
dvine() gives the density, pvine() gives the distribution function,
and rvine() generates random deviates.
The length of the result is determined by n for rvine(), and
the number of rows in u for the other functions.
The vine object is recycled to the length of the
result.
# 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
)
# set up vine copula model
mat <- rvine_matrix_sim(3)
vc <- vine_dist(list(list(distr = "norm")), pcs, mat)
# simulate from the model
x <- rvine(200, vc)
pairs(x)
# evaluate the density and cdf
dvine(x[1, ], vc)
pvine(x[1, ], vc)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.