trunc: Truncate a Regular Vine

Description Usage Arguments Value Examples

View source: R/trunc.rvine.R

Description

Truncates a vine (trunc.rvine), or a vine array (truncvarray).

Usage

1
2
3
4
## S3 method for class 'rvine'
trunc(rv, ntrunc)

truncvarray(G, ntrunc)

Arguments

rv

A regular vine object.

ntrunc

Integer; truncation level. Or, vector specifying the truncation level of each column of the G-Vine array.

G

A vine array.

Value

If ntrunc >= nrow(G) - 1, the original vine is returned. Otherwise, an 'rvine' object is returned with the truncation implemented.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
rv <- rvine(AtoG(CopulaModel::Dvinearray(6)), "frk", 2)
trunc(rv, 3)
trunc(rv, 100)
trunc(rv, 0)

## Column-specific truncation
(rv1 <- trunc(rv, c(0, 1, 2, 1, 2, 4)))
lapply(rv1, identity)
rv2 <- trunc(rv, c(4, 4, 4, 1, 2, 4))
identical(rv1, rv2)

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