Learn R Programming

esreg

The goal of esreg is to simultaneously model the quantile and the Expected Shortfall of a response variable given a set of covariates.

Installation

CRAN (stable release)

You can install the released version from CRAN:

install.packages("esreg")

GitHub (development)

The latest version of the package is under development at GitHub. You can install the development version using these commands:

install.packages("devtools")
devtools::install_github("BayerSe/esreg")

If you are using Windows, you need to install the Rtools for compilation of the codes.

Examples

# Load the esreg package
library(esreg)

# Simulate data from DGP-(2) in the 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")

References

A Joint Quantile and Expected Shortfall Regression Framework

Copy Link

Version

Install

install.packages('esreg')

Monthly Downloads

272

Version

0.6.2

License

GPL-3

Maintainer

Sebastian Bayer

Last Published

May 13th, 2023

Functions in esreg (0.6.2)

lambda_matrix

Lambda Matrix
sigma_matrix

Sigma Matrix
vcovB

Bootstrap Covariance Estimation
estfun.esreg

Estimating function
vcovA

Asymptotic Covariance Estimation
vcov.esreg

Covariance Estimation
G1_prime_prime_fun

Specification Function
esreg

Joint Quantile and Expected Shortfall Regression
G1_fun

Specification Function
G2_curly_fun

Specification Function
G2_prime_prime

Specification Function
cdf_at_quantile

Cumulative Density Function at Quantile
G2_prime_fun

Specification Function
conditional_mean_sigma

Conditional Mean and Sigma
G2_fun

Specification Function
esr_loss

Joint Loss Function
G_vec

Vectorized call to the G1 / G2 functions
conditional_truncated_variance

Conditional truncated variance
G1_prime_fun

Specification Function
density_quantile_function

Density Quantile Function
esr_rho_lp

Joint (VaR, ES) loss for a linear predictor