The goal of
esreg is to simultaneously model the quantile and the Expected Shortfall of a response variable given a set of covariates.
You can install the released version from CRAN:
The latest version of package is under development at GitHub. You can install version from github with:
If you are using Windows, you need the Rtools for compilation of the codes.
# Load the esreg package library(esreg) # Simulate data from DGP-(2) of the linked paper set.seed(1) x <- rchisq(1000, df = 1) y <- -x + (1 + 0.5 * x) * rnorm(1000) # Estimate the model and the covariance fit <- esreg(y ~ x, alpha = 0.025) cov <- vcov(object = fit, sparsity = "nid", cond_var = "scl_sp")
A Joint Quantile and Expected Shortfall Regression Framework