cdensity: Kernel Smoothed Joint Scedasis Density

Description Usage Arguments Details Value Author(s) References Examples

View source: R/cdensity.R

Description

This function computes a kernel joint scedasis density estimate.

Usage

1
cdensity(XY, tau = 0.95, raw = TRUE, ...)

Arguments

XY

data frame from which the estimate is to be computed; first column corresponds to time, the second and third columns correspond to the variables of interest X and Y respectively.

tau

value used to threshold the data Z = min(X, Y); by default threshold = quantile(Z, tau).

raw

logical; if TRUE, X and Y will be converted to unit Fréchet scale. If FALSE, X and Y will be understood as already in unit Fréchet scale. If a single variable is provided raw is automatically set to TRUE.

...

further arguments for density methods.

Details

This function learns about the joint scedasis function using kernel methods as discussed in Palacios and de Carvalho (2020). In the particular case where XY contains no third column, the function learns about the scedasis function of Einmahl et al (2016).

Value

c

scedasis density estimator.

k

number of exceedances above the threshold.

w

standardized indices of exceedances.

XY

raw data.

The plot method depicts the smooth scedasis density.

Author(s)

Miguel de Carvalho and Vianey Palacios

References

Einmahl, J. H., Haan, L., and Zhou, C. (2016) Statistics of heteroscedastic extremes. Journal of the Royal Statistical Society: Ser. B, 78(1), 31–51.

Palacios, V. and de Carvalho, M. (2020) Bayesian semiparametric modeling of jointly heteroscedastic extremes. Preprint.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
data(lse)
attach(lse)
XY <- data.frame(DATE[-1], -diff(log(ROYAL.DUTCH.SHELL.B)))
T <- dim(XY)[1]
k <- floor((0.4258597) * T / (log(T)))
fit <- cdensity(XY, kernel = "biweight", bw = 0.1 / sqrt(7))
plot(fit)
plot(fit, original = FALSE)

## Example from Palacios and de Carvalho (2020, submitted)
library(evd)
T <- 5000
time <- seq(1/T, 1, by = 1/T)
set.seed(1263)
aux <- matrix(0,T,2)
for(i in 1:T) {
    aux[i,] <- rbvevd(1,dep=sin(time[i]*pi),model="log",
    mar1 = c(1, 1, 1), mar2 = c(1,1,1))}
XY <- cbind(time,aux)
fit <- cdensity(XY, kernel = "biweight", bw = 0.1)
plot(fit)

extremis documentation built on Nov. 27, 2020, 9:07 a.m.

Related to cdensity in extremis...