getters: Extracts components of 'bicop_dist' and 'vinecop_dist'...

gettersR Documentation

Extracts components of bicop_dist and vinecop_dist objects

Description

Extracts either the structure matrix (for vinecop_dist only), or pair-copulas, their parameters, Kendall's taus, or families (for bicop_dist and vinecop_dist).

Usage

get_structure(object)

get_pair_copula(object, tree = NA, edge = NA)

get_parameters(object, tree = NA, edge = NA)

get_ktau(object, tree = NA, edge = NA)

get_family(object, tree = NA, edge = NA)

get_all_pair_copulas(object, trees = NA)

get_all_parameters(object, trees = NA)

get_all_ktaus(object, trees = NA)

get_all_families(object, trees = NA)

Arguments

object

a bicop_dist, vinecop_dist or vine_dist object.

tree

tree index (not required if object is of class bicop_dist).

edge

edge index (not required if object is of class bicop_dist).

trees

the trees to extract from object (trees = NA extracts all trees).

Details

#' The get_structure method (for vinecop_dist or vine_dist objects only) extracts the structure (see rvine_structure for more details).

The get_matrix method (for vinecop_dist or vine_dist objects only) extracts the structure matrix (see rvine_structure for more details).

The other get_xyz methods for vinecop_dist or vine_dist objects return the entries corresponding to the pair-copula indexed by its tree and edge. When object is of class bicop_dist, tree and edge are not required.

  • get_pair_copula() = the pair-copula itself (see bicop).

  • get_parameters() = the parameters of the pair-copula (i.e., a numeric scalar, vector, or matrix).

  • get_family() = a character for the family (see bicop for implemented families).

  • get_ktau() = a numeric scalar with the pair-copula Kendall's tau.

The get_all_xyz methods (for vinecop_dist or vine_dist objects only) return lists of lists, with each element corresponding to a tree in trees, and then elements of the sublists correspond to edges. The returned lists have two additional attributes:

  • "d" = the dimension of the model.

  • "trees" = the extracted trees.

Value

The structure matrix, or pair-copulas, their parameters, Kendall's taus, or families.

Examples

# specify pair-copulas
bicop <- bicop_dist("bb1", 90, c(3, 2))
pcs <- list(
  list(bicop, bicop), # pair-copulas in first tree
  list(bicop) # pair-copulas in second tree
)

# specify R-vine matrix
mat <- matrix(c(1, 2, 3, 1, 2, 0, 1, 0, 0), 3, 3)

# set up vine copula model
vc <- vinecop_dist(pcs, mat)

# get the structure
get_structure(vc)
all(get_matrix(vc) == mat)

# get pair-copulas
get_pair_copula(vc, 1, 1)
get_all_pair_copulas(vc)
all.equal(get_all_pair_copulas(vc), pcs,
          check.attributes = FALSE, check.environment = FALSE)

rvinecopulib documentation built on March 7, 2023, 6:20 p.m.