d_logd_rvine: Density of a Regular Vine

Description Usage Arguments Details Value See Also Examples

Description

Evaluates the density of a regular vine model (drvine) or log density (logdrvine).

Usage

1
2
3
logdrvine(dat, rv)

drvine(dat, rv)

Arguments

dat

Data matrix. Rows are observations, and columns are variables. Could be a vector if there's only one observation.

rv

Regular vine object

Details

This function is a wrapper for rvinellkv.trunc2 in the CopulaModel package.

Value

Vector of length = number of observations in dat, representing the evaluated joint density of the variables in G.

See Also

rvine

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
set.seed(123)
G <- AtoG(CopulaModel::Cvinearray(4))[1:3, ]
copmat <- makeuppertri(c("gum", "gal", "bvtcop",
                         "bvncop", "frk"), row = 2, col = 4, blanks = "")
cparmat <- makeuppertri.list(c(1.5, 1.5, 0.9, 3, 0.1, 0.5),
                             len = c(1,1,2,1,1), row = 2, col = 4)
rv <- rvine(G=G, copmat=copmat, cparmat=cparmat)
dat <- rrvine(10, rv)
logdrvine(dat, rv)
drvine(runif(4), rv)

## The variables in G don't need to refer to all data:
u <- runif(4)
drvine(u, subset(rv, 1:2))
## ...is the same as:
drvine(u[1:2], subset(rv, 1:2))

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