RVineMatrix {VineCopula} | R Documentation |
R-Vine Copula Model in Matrix Notation
Description
This function creates an RVineMatrix()
object which encodes an
R-vine copula model. It contains the matrix identifying the R-vine tree
structure, the matrix identifying the copula families utilized and two
matrices for corresponding parameter values.
Usage
RVineMatrix(
Matrix,
family = array(0, dim = dim(Matrix)),
par = array(NA, dim = dim(Matrix)),
par2 = array(NA, dim = dim(Matrix)),
names = NULL,
check.pars = TRUE
)
Arguments
Matrix |
Lower (or upper) triangular d x d matrix that defines the R-vine tree structure. |
family |
Lower (or upper) triangular d x d matrix with zero diagonal
entries that assigns the pair-copula families to each (conditional) pair
defined by |
par |
Lower (or upper) triangular d x d matrix with zero diagonal
entries that assigns the (first) pair-copula parameter to each (conditional)
pair defined by |
par2 |
Lower (or upper) triangular d x d matrix with zero diagonal
entries that assigns the second parameter for pair-copula families with two
parameters to each (conditional) pair defined by |
names |
A vector of names for the d variables; default: |
check.pars |
logical; default is |
Value
An object of class RVineMatrix()
, i.e., a list with the
following components:
Matrix |
R-vine tree structure matrix. |
family |
pair-copula family matrix with values as above. |
par |
pair-copula parameter matrix. |
par2 |
second pair-copula parameter matrix with parameters necessary for pair-copula families with two parameters. |
names |
variable names (defaults to |
MaxMat , CondDistr |
additional matrices required internally for evaluating the density etc., |
type |
the type of the vine copula structure; possible types are:
|
tau |
Kendall's tau matrix, |
taildep |
matrices of lower and upper tail dependence coefficients, |
beta |
Blomqvist's beta matrix. |
Objects of this class are also returned by the RVineSeqEst()
,
RVineCopSelect()
, and RVineStructureSelect()
functions. In this case, further information about the fit is added.
Note
For a comprehensive summary of the vine copula model, use
summary(object)
; to see all its contents, use str(object)
.
The RVineMatrix()
function automatically checks if the given
matrix is a valid R-vine matrix (see RVineMatrixCheck()
).
Although the function allows upper triangular matrices as its input, it will
always store them as lower triangular matrices.
Author(s)
Jeffrey Dissmann, Thomas Nagler
References
Dissmann, J. F., E. C. Brechmann, C. Czado, and D. Kurowicka (2013). Selecting and estimating regular vine copulae and application to financial returns. Computational Statistics & Data Analysis, 59 (1), 52-69.
See Also
RVineMatrixCheck()
,
RVineSeqEst()
,
RVineCopSelect()
,
RVineStructureSelect()
,
RVineSim()
,
C2RVine()
,
D2RVine()
Examples
# define 5-dimensional R-vine tree structure matrix
Matrix <- c(5, 2, 3, 1, 4,
0, 2, 3, 4, 1,
0, 0, 3, 4, 1,
0, 0, 0, 4, 1,
0, 0, 0, 0, 1)
Matrix <- matrix(Matrix, 5, 5)
# define R-vine pair-copula family matrix
family <- c(0, 1, 3, 4, 4,
0, 0, 3, 4, 1,
0, 0, 0, 4, 1,
0, 0, 0, 0, 3,
0, 0, 0, 0, 0)
family <- matrix(family, 5, 5)
# define R-vine pair-copula parameter matrix
par <- c(0, 0.2, 0.9, 1.5, 3.9,
0, 0, 1.1, 1.6, 0.9,
0, 0, 0, 1.9, 0.5,
0, 0, 0, 0, 4.8,
0, 0, 0, 0, 0)
par <- matrix(par, 5, 5)
# define second R-vine pair-copula parameter matrix
par2 <- matrix(0, 5, 5)
## define RVineMatrix object
RVM <- RVineMatrix(Matrix = Matrix, family = family,
par = par, par2 = par2,
names = c("V1", "V2", "V3", "V4", "V5"))
## see the object's content or a summary
str(RVM)
summary(RVM)
## inspect the model using plots
## Not run: plot(RVM) # tree structure
contour(RVM) # contour plots of all pair-copulas
## simulate from the vine copula model
plot(RVineSim(500, RVM))