copula (version 1.1-3)

nesdepth: Nesting Depth of a Nested Archimedean Copula ("nacopula")

Description

Compute the nesting depth of a nested Archimedean copula which is the length of the longest branch in the tree representation of the copula, and hence at least one.

Usage

nesdepth(x)

Value

an integer, the nesting depth of the nested Archimedean copula. An (unnested) Archimedean copula has depth 1.

Arguments

x

object of class "nacopula".

See Also

dim of nacopulas.

Examples

Run this code
F2 <- onacopula("F", C(1.9, 1, C(4.5, c(2,3))))
F2
F3 <- onacopula("Clayton", C(1.5, 3:1,
                             C(2.5, 4:5,
                               C(15, 9:6))))
nesdepth(F2) # 2
nesdepth(F3) # 3
# \dontshow{
stopifnot(identical(nesdepth(F2), 2L),
          identical(nesdepth(F3), 3L),
          identical(nesdepth(onacopula("Gumbel", C(1.5, 3:1))), 1L))
# }

Run the code above in your browser using DataLab