rrvine: Simulate from a Regular Vine

Description Usage Arguments Details Value Note Examples

View source: R/rrvine.R

Description

Simulate from a Regular Vine. Essentially a wrapper for rvinesimvec2. NOTE: Marginals not working yet, so data are marginally Uniform.

Usage

1
rrvine(n, rv, iprint = FALSE)

Arguments

n

Number of observations to generate

rv

Regular vine object, complete.

iprint

Logical, as in rvinesimvec2, which says "print flag for intermediate results".

Details

The vine variables vars(rv) are the column numbers of the outputted data. So NA columns are introduced if necessary. That is, if the variables are outside of the set {1:length(vars(rv))}, then the columns of the outputted data outside of the set {1:max(vars(rv))} will be NA.

Value

Matrix with n rows and max(vars(rv)) columns.

Note

Like in rvinesimvec2, the copula families are assumed to be permutation symmetric.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
rv <- rvine(AtoG(CopulaModel::Dvinearray(5)), "frk", makeuppertri(2, 4, 5))
set.seed(123)

## Simulate 10 observations:
rrvine(10, rv)

## Simulate 0 and 1 variables too:
rrvine(10, subset(rv, integer(0)))
rrvine(10, subset(rv, 1))

## Vine variables outside of the set 1,2,3,...?
rrvine(10, relabel(rv, c(3, 8, 1, 6, 2)))

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