Learn R Programming

⚠️There's a newer version (0.6.2) of this package.Take me there.

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 package is under development at GitHub. You can install version from github with:

install.packages("devtools")

devtools::install_github('BayerSe/esreg').

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

Examples

# 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")

References

A Joint Quantile and Expected Shortfall Regression Framework

Copy Link

Version

Install

install.packages('esreg')

Monthly Downloads

272

Version

0.3.1

License

GPL-3

Maintainer

Sebastian Bayer

Last Published

August 22nd, 2017

Functions in esreg (0.3.1)

G1_fun

Specification Function
G1_prime_fun

Specification Function
vcov.esreg

Covariance Estimation for esreg
vcov.esreg_twostep

Covariance Estimation for esreg_twostep
conditional_truncated_variance

Conditional truncated variance
density_quantile_function

Density Quantile Function
summary.esreg

esreg summary
summary.esreg_twostep

esreg_twostep summary
G2_prime_fun

Specification Function
G_vec

Vectorized call to the G1 / G2 functions
esr_rho_lp

Joint (VaR, ES) loss for a linear predictor
esr_loss

Joint Quantile and Expected Shortfall Loss Function
esr_psi_lp

Identification (moment) function for the pair (VaR, ES) for a linear predictor
esreg_twostep

Two Step Quantile and Expected Shortfall Regression
gpl

Generalized Piecewise Linear Loss Function
G2_fun

Specification Function
esreg

Joint Quantile and Expected Shortfall Regression
G2_curly_fun

Specification Function