pcondseq: Compute Conditional Probabilities Sequentially

Description Usage Arguments Details Value Examples

View source: R/pcondseq.R

Description

Given a vine describing the joint distribution of some uniform data, this function sequentially evaluates conditional distributions given previous variables in a specified order. See details.

Usage

1
pcondseq(dat, ord, rv)

Arguments

dat

Data matrix with uniform scores.

ord

order of variables

rv

A regular vine, supposedly describing the joint distribution of dat.

Details

Suppose Ui denotes random variable i. If you specify ord=c(5, 2, 3, 1), you'll get the cdfs of U5; U2|U5; U3|(U2,U5); and U1|(U3,U2,U5), evaluated at the data.

In general, this function computes:

Value

Matrix with rows being observations in dat, and columns being U[ord[1]]; U[ord[2]]|U[ord[1]]; U[ord[3]]|U[ord[1:2]]; etc.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Make a vine
G <- AtoG(CopulaModel::Dvinearray(4))
rv <- rvine(G, "frk", 3)

## Generate sample
set.seed(123)
dat <- rrvine(10, rv)

## Try it out:
pcondseq(dat, c(4, 3, 2), rv)
pcondseq(dat, 1, rv)

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