augment.rvine: Add to a Column of an 'rvine'

Description Usage Arguments Note Examples

View source: R/augment.rvine.R

Description

Adds extra layers to a specified column of an rvine object, including adding a new column altogether.

Usage

1
2
## S3 method for class 'rvine'
augment(obj, a, cop, cpar, col = NULL)

Arguments

obj

The object of type rvine with which to augment.

a

Vector of vine array indices to append to the vine array column.

cop

Vector of copula families to append to the copula matrix column.

cpar

List of copula parameters to append to the parameter matrix column.

col

The column of the vine to add to (i.e., the common column of the vine array, and copula and parameter matrices). NULL (default) if you want to add a new column to the vine.

Note

If you're adding a new column with only one variable, there's no need to specify the cop and cpar arguments.

Some checks are built-in to ensure that the resulting vine is indeed an rvine, but it's not comprehensive. Would be nice to have some function like is.rvine to check for sure.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
## Add to an empty vine:
rv <- rvine(matrix(nrow=0, ncol=0))
summary(rv)
rv2 <- augment(rv, a=4, col=1)
summary(rv2)

## Add to an independence vine:
rv <- rvine(matrix(4:1, ncol = 4))
summary(rv)
rv2 <- augment(rv, a=c(4,3),
               cop=c("bvtcop", "bvncop"),
               cpar=list(c(0.5, 3), -0.7),
               col=3)
summary(rv2)
summary(augment(rv2, integer(0)))

## You can't do some illegal things.
## Not run: 
augment(rv, a=1)
augment(rv, a=3:4, cop=c("frk", "frk"),
        cpar=list(4,3), col=2)
augment(rv, a=5:1, cop="frk", cpar=list(4))

## End(Not run)
## But you can do some:
rv2 <- augment(rv, a=c(5,5), cop="frk", cpar=list(4))
summary(rv2)

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