Description Usage Arguments Details Value Author(s) References See Also Examples
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.
1 2 3 4 5 6 7 8 9 10 11 |
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. |
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:
"s" is the simple RPoT where the dynamic parameters are fully characterized by the realized measures,
φ_t=f_p(ψ x_t), \quad σ_t=f_s(γ x_t), \quad ξ_t=f_x(δ x_t)
with f(\cdot) the corresponding link function.
"ar" includes also an autoregressive component in the dynamic parameters. Let φ=f_p(\tilde{φ}), σ=f_s(\tilde{σ}), ξ=f_x(\tilde{ξ}) then
\tilde{φ}_t=ψ_1 + ψ_{ar} \tilde{φ}_{t-1} + ψ_{-} x_t,
\tilde{σ}_t=γ_1 + γ_{ar} \tilde{σ}_{t-1} + γ_{-} x_t,
\tilde{ξ}_t=δ_1 + δ_{ar} \tilde{ξ}_{t-1} + δ_{-} x_t
where ψ_{-}, γ_{-}, δ_{-} are the remaining parameters in the estimates
vector.
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).
Luca Trapin
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.
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.