makevinemat: Construct a Matrix for a Vine

Description Usage Arguments Details Value Note Examples

View source: R/makevinemat.R

Description

Use this function to construct a vine array, copula matrix, or copula parameter matrix. Do so by specifying layers in the vine (columns in the matrix) or trees in the vine (rows in the matrix). A full matrix need not be constructed.

Usage

1
makevinemat(..., bylayer = TRUE, zerocol = FALSE)

Arguments

...

Vectors or lists to construct the matrix with.

bylayer

TRUE if ... are layers (columns in the outputted matrix). FALSE if they are trees (rows in the outputted matrix).

zerocol

Should there be an "empty" column appended to the left of the outputted matrix? Useful for making copula matrices, for example.

Details

If you want an entry of the matrix to contain something other than a vector of length 1 (for example, copula parameters of dimension different from 1), specify the entries within a list in ....

"Empty" entries are either list(NULL) if the matrix entries aren't all vectors of length 1, 0 if the matrix is numeric, or "" if the matrix is of type "character".

Value

If bylayer is TRUE, the returned matrix places entries in "..." as columns from left to right, as if building a vine by adding layers. Empty portions of the columns are put at the bottom of the column.

If bylayer is FALSE, the returned matrix places entries in "..." as rows from top to bottom, as if building a vine by specifying tree depths. Empty portions of the rows are put to the left of the row.

Note

If you intend to build a vine array with this function, you'll get "tree 0" (the variable nodes) in row 1, instead of the diagonal. To convert to the "traditional" form, use contoA.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## Vine array
makevinemat(1, c(2,1), c(3, 1, 2), c(4, 1, 2, 3))
makevinemat(1, c(2,1), c(3, 1, 2), c(4, 1), c(5, 1:4))
makevinemat()

## Two layers of a vine array
makevinemat(c(4,1), c(5, 1:4))

## Copula Matrix
makevinemat(c("gum", "gum", "bvtcop"), c("frk", "", "joe"),
            bylayer = FALSE, zerocol = TRUE)
makevinemat(zerocol = TRUE)

## Copula Parameter Matrix
makevinemat(list(2.4, 3.8, c(0.6, 7)), c(4.5, 2.3), bylayer=F, zerocol=T)
makevinemat(1:3, 4:5, bylayer=F, zerocol=T)

vincenzocoia/copsupp documentation built on Aug. 23, 2020, 7:37 a.m.