extrCoeff: Calculates extremal coefficients

View source: R/gr_extrCoeff.R

extrCoeffR Documentation

Calculates extremal coefficients

Description

Computes parametric and non-parametric extremal coefficients. For explanation of extremal coefficients see Vignette "Additional functionalities".

Usage

extrCoeff(obj, ...)

## S3 method for class 'Network'
extrCoeff(obj, k_ratio, v = NULL, ...)

## S3 method for class 'HRMtree'
extrCoeff(obj, v = NULL, ...)

## S3 method for class 'HRMBG'
extrCoeff(obj, v = NULL, ...)

Arguments

obj

If it is an object of class Network non-parametric estimates are computed. If it is an object of class HRMtree, parametric EC are computed. If object of class HRMBG is passed, parametric EC are computed.

...

additional arguments

k_ratio

is the number of upper order statistics divided by the total number of observations.

v

a vector of length the number of nodes and named according to the names of the nodes. NULL by default. See Details.

Details

If the vector v is non NULL then an extremal coefficient is computed based on the vector v. This means for instance that if v is (0, 1, 0, 2.5, 1.8) with names (a,b,c,d, e) then a trivariate extremal coefficient is computed taking coordinates (b,d,e) to be equal to 1. If the vector v is NULL, then bivariate extremal coefficients are computed and ordered in a matrix of pairwise extremal coefficients.

Value

Either a scalar for the value of the extremal coefficient or a matrix of pairwise extremal coefficients. If the argument v is NULL then it returns a matrix of pairwise extremal coefficients.

Examples

# bivariate extremal coefficients of a tree model
g<- graph(c(1, 2, 2, 3, 2, 4), directed = FALSE)
g<- set.vertex.attribute(g, "name", V(g), c("a", "b", "c", "d"))
obj<- HRMtree(g)
obj<- setParams(obj, c(0.2, 0.3, 0.4))
extrCoeff(obj)
# arbitrary vector of coordinates
v<- c(1,2,0,6); names(v)<- c("a", "b", "c", "d")
extrCoeff(obj, v)

# non-parametric extremal coefficients
data<- matrix(rnorm(4 * 500), 500, 4)
colnames(data)<- c("a" , "b", "c", "d")
tobj<- Tree(g, data)
extrCoeff(tobj, 0.2)
# arbitrary vector of coordinates
v<- c(1, 2, 0, 6); names(v)<- c("a", "b", "c", "d")
extrCoeff(tobj, k_ratio = 0.2, v = v)

#bivariate extremal coefficients of a block graph model
g<- graph(c(1, 2, 2, 3, 1, 3, 3, 4, 4, 5, 3, 5), directed = FALSE)
g<- set.vertex.attribute(g, "name", V(g), c("a", "b", "c", "d", "e"))
obj<- HRMBG(g)
obj<- setParams(obj, c(0.2, 0.3, 0.4, 0.5, 0.6, 0.1))
extrCoeff(obj)
# arbitrary vector of coordinates
v<- c(1, 1, 0, 1, 1); names(v)<- c("a", "b", "c", "d", "e")
extrCoeff(obj, v)

gremes documentation built on Feb. 16, 2023, 8:06 p.m.