rpot: Realized Peaks over Threshold

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/rpot.R

Description

Fits a Realized Peaks over Threshold (RPoT) model as in Bee et al. (2019). Realized measures can be used to model the dynamics of the exceedance probability (φ), and the scale (σ) and tail (ξ) parameters of the Generalized Pareto distribution.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
rpot(
  r,
  q,
  x,
  model = "s",
  xp,
  xs,
  xx,
  lf = c("logit", "exp", "identity"),
  sv = NULL
)

Arguments

r

Vector of returns on an asset.

q

A constant threshold (scalar).

x

Matrix of realized measures. The intercept must be included, i.e. set the first column to a vector of ones.

model

Type of model. "s" is default. See the details.

xp

Select which realized measures (columns of x) appear in phi.

xs

Select which realized measures (columns of x) appear in sigma.

xx

Select which realized measures (columns of x) appear in xi.

lf

Link function for phi, sigma and xi. See details.

sv

Vector of starting values. This is an optional argument.

Details

Parameters are estimated by Maximum Likelihood. Optimization is performedusing the "Nelder-Mead" algorithm of the optim() function. The joint likelihood function of the RPoT model is

∏^{T}_{t=1}(1-φ_t)^{1-I_t}≤ft(\frac{φ_t}{σ_t}≤ft(1+\frac{ξ_t}{σ_t}\right)^{-\frac{1}{ξ_t}-1}\right)^{I_t}

where I_t is the indicator function of the exceedancees.

lf is used to constraint the parameters to the appropriate parameter space. The link function can be either "logit" (logistic function), "exp" (exponential function) or "identity" (identity function). The logistic is the only function that can be used for phi. The exponential and identity functions can be used for sigma and xi. Default is lf=c("logit","exp","identity").

model allows to select two different models:

Value

A list containing:

model

Type of model.

estimates

Vector of regression parameters: psi, gamma, delta.

value

Maximized log-likelihood.

parameters

Matrix containing the fitted values of phi, sigma, and xi.

lf

Link function for phi, sigma and xi.

threshold

Constant threshold (q).

Author(s)

Luca Trapin

References

Bee, M., Dupuis, D. J., and Trapin, L. (2019). Realized Peaks over Threshold: A Time-Varying Extreme Value Approach with High-Frequency-Based Measures. Journal of Financial Econometrics, 17(2), 254-283.

See Also

rpot.fitted, rpot.forecast

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
# Define a lag structure for the return and the realized variane
n   <- nrow(sp500)
rx  <- sp500$r[-1]
rvx <- sp500$rv[-n]

# Define the threshold
q <- quantile(rx, 0.9)

# Define the covariate structure
x  <- cbind(1,log(rvx))
xp <- c(1,2)
xs <- c(1,2)
xx <- 1

# Fit the RPOT model
fit <- rpot(rx, q, x, model="s", xp, xs, xx)

lucatrapin/FinEx documentation built on Dec. 21, 2021, 11:52 a.m.