Learn R Programming

extremis (version 1.2.1)

cmodes: Mode Mass Function

Description

This function computes the mode mass function.

Usage

cmodes(Y, thresholds = apply(Y[, -1], 2, quantile, probs =
                 0.95), nu = 100, ...)

Value

c

scedasis density estimators.

k

number of exceedances above the threshold.

w

standardized indices of exceedances.

Y

raw data.

The plot method depicts the smooth mode mass function along with the smooth scedasis densities.

Arguments

Y

data frame from which the estimate is to be computed; first column corresponds to time and the second to the variable of interest.

thresholds

values used to threshold the data y; by default threshold = quantile(y, 0.95).

nu

concentration parameter of beta kernel used to smooth mode mass function.

...

further arguments for density methods.

Author

Miguel de Carvalho

Details

The scedasis functions on which the mode mass function is based are computed using the default "nrd0" option for bandwidth.

References

Rubio, R., de Carvalho, M., and Huser, R. (2018) Similarity-Based Clustering of Extreme Losses from the London Stock Exchange. Submitted.

Examples

Run this code
data(lse)
attach(lse)
nlr <- -apply(log(lse[, -1]), 2, diff)
Y <- data.frame(DATE[-1], nlr)
T <- dim(Y)[1]
k <- floor((0.4258597) * T / (log(T)))
fit <- cmodes(Y, thresholds = as.numeric(apply(nlr, 2, sort)[T - k, ]),  
              kernel = "biweight", bw = 0.1 / sqrt(7), nu = 100)
plot(fit)

Run the code above in your browser using DataLab