Value-at-Risk Estimation via Quantile Regression with Selected Variables from LASSO

21  Download (0)

Full text


Value-at-Risk Estimation via Quantile Regression with Selected Variables from LASSO

Kyungwhan Oh 11928433

Supervisor: Sander Barends June 30, 2021


As Value-at-Risk (VaR) has become the standard financial risk measure, various VaR models have been established to forecast VaR precisely. In this research, the contribution of the quantile regression technique on the accuracy of VaR models with post-selected variables from LASSO has been examined using daily returns of S&P 500 in practice. The accuracy of the models was tested by a linear regression-based test. By comparing the test results before and after applying quantile regression on VaR models, improvement of the accuracy of the models was observed.



Statement of Originality

This document is written by Kyungwhan Oh who declares to take full responsibility for the contents of this document.

I declare that the text and the work presented in this document are original and that no sources other than those mentioned in the text and its references have been used in creating it.

UvA Economics and Business is responsible solely for the supervision of completion of the work, not for the contents.



I Introduction

Lehman Brothers, one of the world’s leading investment banks, filed for bankruptcy in 2008 after failing to withstand debt. This crisis resulted from inaccurate predictions for future market risk. As shown in the collapse of Lehman Brothers, forecasting the future market risk is vital for financial institutions and regulators regardless of their scale to prevent significant potential loss.

Value-at-Risk (VaR) has become a standard financial risk measure in recent develop- ment (Linsmeier & Pearson, 2000). VaR measures the maximum loss of a portfolio over a specific time horizon with a given probability. If an estimated daily VaR is 3% with 95%

confidence level, the worst daily loss is expected not to exceed $3 of a $100 investment.

As VaR has started to be widely used, various VaR models have been established to estimate VaR precisely. Typical VaR models are historical simulation and RiskMetrics. The historical simulation calculates VaR as a sample percentile of portfolio returns. On the other hand, RiskMetrics proposed by Morgan (1996) uses time-varying volatility components. Based on these two approaches, VaR models can be constructed.

In this research, a linear regression-based test was used to identify the accuracy of VaR models. A good VaR model should incorporate all current information on future risk. However, including too many regressors in the linear regression test, which stands for potential market risk factors, can lead to poor performance of the test caused by overfitting. This results from the accumulation of estimation errors involved in estimating all the regression coefficients. In order to settle this problem, only the relevant variables should be employed. The variables used as regressors in the linear regression test can be determined by the post-selection method.

One of the most well-known linear regression-based post-selection methods is the least absolute shrinkage and selection operator (LASSO) proposed by Tibshirani (1996). LASSO penalizes insignificant coefficients and forces them to zero. Then, the regressors found to be non-zero coefficients can be included in the VaR model.

The main concern of a VaR model is how precisely the model estimates VaR. A correctly specified model should return all the estimated coefficients to zero. If the model fails the test, the variables which would be included in the model should be differently chosen by repeating the previous LASSO step.



Instead of simply carrying out the variable selection procedure again, I constructed a new VaR model using quantile regression established by Koenker and Basset (1978) to enhance the accuracy of the model. Since quantile regression can estimate a particular quantile, VaR can be directly obtained from the estimation result due to its nature. The accuracy of the new VaR model can be attained by repeating the same process of the previous test of the original VaR model.

This research investigated if quantile regression can improve the VaR model with se- lected variables by LASSO regression. By comparing the VaR test results before and after the quantile regression, whether the original VaR models are improved or not was verified. Accord- ing to the outputs of this research, quantile regression indeed contributed to the enhancement of the accuracy of VaR models either in historical simulation and RiskMetrics.

In section 2, literature involving theoretical backgrounds related to this research or sim- ilar past studies are reviewed. In section 3, a description of used data and details of applicable methodologies are discussed. In section 4, empirical results and the corresponding interpreta- tion with numerical comparison are presented. In section 5, the conclusion of this research is given, including the suggestion for further study.

II Literature Review

Historical simulation is one of the most straightforward approaches for the VaR model.

This does not require parameter estimation as well as any distributional assumptions (Bo- hdalová, 2007). The historical simulation is based on the rolling window method. The rolling window indicates using the same size of the information set in each iteration with time variance (Inoue et al., 2017). Hence, VaR can be obtained by repeatedly computing a certain percentile of each simulation (Hull & White, 1998).

On the other hand, RiskMetrics calculates VaR using conditional mean and conditional variance (Morgan, 1996). The conditional variance can be estimated by exponentially weighted moving average (EWMA). EWMA weighs the most recent samples the most while the most distant samples are weighted the least (Hunter, 1986).

The estimate of conditional variance by EWMA is suggested by volatility clustering.

The volatility clustering property is prevalent in the time series of financial asset returns (Lux



& Marchesi, 2000). This phenomenon indicates that large return changes tend to be followed by large return changes (Cont, 2007). This implies that squared portfolio returns of a time series data might have positive autocorrelation. Since RiskMetrics can account for volatility clustering property caused by autocorrelation, this approach is often preferred over historical simulation (Bohdalová, 2007).

Koenker and Basset (1978) introduced a quantile regression. Quantile regression esti- mates conditional quantile of a response variable with respect to covariates (Koenker & Hal- lock, 2001). VaR is the amount of loss within a given probability of occurrence. In other words, VaR indicates the threshold point where the extreme values will not be observed in a certain confidence level. This implies that the quantile regression can be a natural candidate of the VaR estimator since VaR represents a specific tail quantile. The quantile regression allows exam- ining the relationship between a set of covariates and the different parts of the distribution of the response variable (Benoit & Van den Poel, 2009). Furthermore, quantile regression is more robust against outliers since this does not assume the distribution of error terms (Li, 2015).

These advantages can lead to strong speculation that quantile regression can improve the VaR model.

In order to specify the VaR model correctly, proper variables should be included. The variable selection procedure can be conducted based on linear regression. The classical linear regression method is ordinary least squares (OLS). However, OLS can result in huge variance if the covariate vectors are high-dimensional or strongly correlated, leading to poor performance (Hastie et al., 2015). More importantly, the covariate matrix of OLS is not invertible if more regressors exist than observations do. Since a good VaR model should include as many market risk factors as possible, the covariate vectors in the linear regression-based test might consist of many regressors. This implies that the VaR model test can not be performed by OLS.

One of the alternatives is the LASSO regression proposed by Tibshirani (1996). LASSO is a family of least squares methods while using regularization to constrain the regression result further. Regularization indicates reducing the variance at the cost of introducing a particular bias, equivalently decreasing the model complexity (Bickel et al., 2006). To be more specific, LASSO is an extension of OLS by adding a penalty function. By penalizing the coefficients with a proper degree of penalty, LASSO can decrease the model complexity by attenuating the



effect of insignificant regressors (Tibshirani, 1996).

The accuracy of the VaR model can be tested by identifying the validity of two as- sumptions: unconditional coverage and independence. Unconditional coverage can be tested if losses exceed VaR approximately 100p% of the time, and independence can be tested if exceedances occur randomly over time (Christoffersen, 2011).

Instead of testing these assumptions separately, unconditional coverage and indepen- dence can be jointly tested by a linear regression-based test. Christoffersen (1998) employed a hit sequence through indicator function for the test. The hit sequence consists of 1 and 0, where 1 represents the case that the actual loss exceeds minus VaR and 0 in the opposite case. If the model is correctly specified, the exceedance described as a hit sequence should be uncorrelated with all relevant information available at the time the VaR forecast was made.

Likewise, the accuracy of the VaR model can be tested after the variable selection.

This testing procedure is called post-selection inference. Unlike classical inference, the post- selection inference tests the model by collecting data prior to selecting the model. This allows testing the model with a random hypothesis instead of a fixed hypothesis by recognizing the patterns that tend to repeat based on the historical performance of given data (Berk et al., 2013).

III Methodology

III. 1 Data

As a main portfolio data for the analysis, 250 observations of daily S&P 500 adjusted closing prices of 1 year from January 3, 2020 to December 30, 2020 are used (Yahoo Finance, 2021). Adjusted closing price refers to the closing price after the adjustment for all applicable splits and dividend distributions. Only the data when the stock market is opened are collected, and the other data when the market is closed, such as weekends or holidays, are dropped in the data set.

In order to calculate VaR, daily returns of S&P 500 are computed with logarithmic transformation as follows. Let Rtdenote the returns of S&P 500 at time t.

Rt= log(Rt) − log(Rt−1).



Figure 1 indicates the autocorrelation of squared returns until the 100th order lag. The autocorrelation decays steeply until around the 20th lag, and stays slightly over zero.

As mentioned in the previous section, volatility clustering exists in the time series of returns since squared daily returns of S&P 500 have positive autocorrelation. This can be seen more clearly in Figure 2. Figure 2 shows the time series of Rtin the given period. While the series seems to be stationary with a mean of zero, relatively large values of Rt tend to be gathered together at around March, July, September, and November. This volatility clustering property is regarded in RiskMetrics.



As for possible candidates of market risk factors, five variables are considered: Crude oil price (Macrotrends, 2021), Interest rate (FRED, 2021), Inflation rate (FRED, 2021), Unem- ployment rate (FRED, 2021), and Foreign exchange rate1 (OFX, 2021). All the sample data are based on the U.S. in the same given period. Missing data for the corresponding period to Rt are not dropped but filled with the most recent past data. Since only the monthly data are available for the unemployment rate, the same month dates are filled with identical values.

According to Duffie and Pan (1997), interest rate and foreign exchange rate could be the candidates of regressors for a VaR model. Crude oil price, inflation rate, and unemployment rate are intuitively chosen since stock price tends to be sensitive to these factors in general. All these five variables are employed as regressors.

III. 2 Model

VaR can be calculated through the historical simulation approach by finding the p per- centile of m most recent portfolio returns at time t + 1, sorted in ascending order where p is a predetermined significance level, and m is a fixed time horizon.

V aRˆ HSt+1, p = −Percentile({Rt+1−τ}mτ =1, 100p)

In this research, m, the length of fixed time horizon for the information set, is set to 250 (approximately one-year data) to estimate a one-step-ahead forecast with a 95% confidence level. The further step forecasts can be made by updating the information set in each simulation with a fixed amount of 250 observations of the most recent returns. By means of the rolling window method, the next 250 VaR values are estimated in the same period as Rt, from January 3, 2020 to December 30, 2020.

RiskMetrics approach computes VaR as follows under the normality assumption:

V aRˆ RMt+1, p = −µt+1− σt+1Φ−1p

where µ is the conditional mean, σ is the square root of conditional variance, and Φ−1p is the 100pth percentile of standard normal distribution. µ is assumed to be zero due to the mean

1Exchange rate of U.S. Dollar($) against Euro(e)



blur effect, which indicates that standard deviation dominates the mean for daily returns of a portfolio (Christoffersen, 2011). The conditional variance can be estimated based on EWMA expressed as σ2t+1= λσt2+ (1 − λ)R2t where λ is 0.94 as a convention. Then σ can be obtained by taking a square root of the found conditional variance. With a 95% confidence level, Φ−1p is replaced by 1.96. Unlike historical simulation, RiskMetrics uses all past available information set at the time when the estimation is made. Hence, the further steps ahead VaR forecasts are, the more information set is used.

III. 3 Test

In order to perform VaR test, the following linear regression-based test is employed:

It = β0+ β1It−1+ β0Xt−1+ εt

where Itis a hit sequence at time t and Xtis a covariate vector consisting of market risk factors mentioned in the section III. 1.

Hit sequence can be obtained by comparing the estimated VaR from each approach and the realized actual return at time t. The definition is following:

It =

1, Rt< −V aRtp 0, Rt≥ −V aRpt

t = 1, · · · , T

The hit sequence might be a sparse vector composed of few 1s and many 0s. How well the estimated VaR accounts for the actual loss can be found by looking at the proportion of the number of 1s in the hit sequence. A good VaR estimate should have a proportion of the hit sequence similar to the predetermined significance level of 5%.

Since the covariate vector in the given linear regression test should contain as much information as possible, the selected market risk factors above involve various transformations.

In this research, lags, squared of lags, log-transformed lags, and squared of log-transformed lags until the 10th order of the following variables are included: Hit sequence, VaR estimate, volatility, crude oil price, interest rate, inflation rate, unemployment rate, and foreign exchange rate. The hit sequence only includes the lags because of its characteristics. Consequently, the



covariate vectors consist of 290 regressors.

Since all these variables are intuitively chosen as a candidate, certain variables might be irrelevant. Hence, only the proper variables should be included in the VaR model to ensure the accuracy of the model. In this research, OLS turned out to be inappropriate for the variable selection procedure since the number of regressors is larger than the observations. Instead, LASSO regression was employed.

βˆLASSO= arg min


1 T




(It− β0− β1It−1− β0Xt−1)2+ λ





The last term, λ




j|, is called L1 penalty which makes difference from classical OLS regression. The L1 penalty penalizes the coefficients of insignificant variables and en- forces them to become zero. As a result of LASSO, the regressors turned out to have non-zero coefficients are added in the initial VaR model.

To obtain a good result in practice, the hyperparameters of LASSO are tuned by trial and error. The most important hyperparameter is λ since the post-selected variables can be different according to the degree of penalty. λ is increased by small steps from 0 until less than 10 non-zero coefficients are left. Finally, five variables with the largest coefficients are selected.

The accuracy of the VaR model with the post-selected variables from LASSO can be investigated by testing the coefficients of the linear regression test estimated by OLS. If the model is correctly specified, all the coefficients should be zero. Hence, the null hypothesis is

H0 : β0 = β1 = 0 and β = 0.

This can be examined by the Wald test. If the null hypothesis is rejected, at least one of the coefficients is significantly different from zero, which implies the misspecification of the model.

III. 4 Method

Let define Xt as a new covariate vector containing the original VaR estimate and the newly found regressors from LASSO. Then, a new VaR can be estimated using quantile regres-



sion by regressing Rton Xt. Quantile regression for the new VaR is defined as follows:

V aRˆ Qunatt+1, τ = ˆβ0QuantXt where ˆβQuant = arg min

β0 T



ρτ(Rt− β0− β0Xt)

where ρτ(·) is a tilted absolute value function with τth sample quantile. A quantile regression estimates a certain quantile of a variable as a linear function of regressors. This is same as linear regression which minimizes the least absolute residuals. On the other hand, the quantile regres- sion uses conditional median (or a specific quantile) instead of conditional mean (Koenker &

Hallock, 2001). Hence, the new VaR can be obatined by multiplying the estimated coefficients of the quantile regression and the observations of new regressors.

After finding the new VaR, constructing a new VaR model and testing the accuracy of the model take the same process as so far. Firstly, new significant variables can be found by LASSO with a new hit sequence derived from the new VaR. Then, the linear regression test can be carried out again to check if all the coefficients are zero, including the newly found variables.

As a final step, the linear regression test results of each historical simulation and Risk- Metrics are compared ex-ante and ex-post quantile regression. If the model passes the test after the quantile regression, this can be concluded that the VaR model is improved. Although the ex-post model fails the test, improvement of the VaR model can be recognized as far as the p-value of the test is significantly increased after the quantile regression.

IV Empirical Result and Interpretation

The estimated VaR through historical simulation with 95% confidence level is shown in Figure 3. The dashed line indicates the changes of VaR over time in the given period, and this line is relatively flat comparing to the realized actual returns. This seems that VaR does not follow the general trend of fluctuation of daily returns accurately. Especially, the error between VaR and the actual return is larger at the time of exceptionally large losses.

The number of exceedances turned out to be 21 out of 250 observations, where the proportion is 8.4%. This implies that the VaR is underestimated as the proportion is far larger than 5% significance level. Based on this VaR, more losses can be faced than expected.



On the other hand, the estimated VaR through RiskMetrics with 95% confidence level shows the conflicting result with historical simulation. In Figure 4, the dashed line which indicates the VaR seems to reflect the trend of the actual return to some extent. However, VaR shows the tendency of reacting to shocks very sensitively. This can lead to excessive reserve for a financial institution resulting in inefficient investment.

The number of exceedances was 11 out of 250 observations, which represents 4.4%.

This result is close to 5% significance level. However, the volatility of the actual return after a shock does not become lower in a short period. This implies that the VaR is overestimated.



To select less than ten variables from LASSO, the degree of penalty was set differently in each historical simulation and RiskMetrics model. In Figure 5, the changes in coefficient of the respective variable by the changes in λ within the range of [0, 1] are presented. The coefficients of historical simulation decrease rapidly in the early stage and stay close to zero until λ is slightly over 0.5. On the other hand, the coefficients of RiskMetrics decrease more gently and tend to converge close to zero at around 0.25 of λ. The value of λ for historical simulation was set to 0.3 and RiskMetrics to 0.09 by trial and error based on Figure 5.

As a result of LASSO regression, different ten variables of each model are returned2. The majority of coefficients of the variables which are non-zero turned out to be related to the oil price. Finally, the five selected variables in each model are following: The squared of 4th, 5th, 6th order lag of oil price, and the squared of 1st, 5th order lag of unemployment rate for historical simulation; the squared of 1st, 4th, 6th, 9th order lag of oil price, and the squared of 4th lag of log-volatility for RiskMetrics.

The subsequent Wald test results of the two VaR models showed p-values of 0.000 and 0.001 respectively. The null hypotheses are rejected in both cases since p-values are lower than 0.05. Hence, there is no sufficient evidence to insist that the VaR models are correctly specified.

This implies that at least one of the coefficients of regressor turned out to be non-zero, which means not independent from the hit sequence.

2see Table 1.





Table 2 represents the estimated coefficients of quantile regression of each historical simulation and RiskMetrics models with newly found regressors in the previous stage. In either model, the coefficients of newly added regressors are relatively much smaller than the coeffi- cient of the original estimated VaR. This implies that the new VaR can be adjusted primarily under the influence of the coefficient of the original VaR.

The absolute value of the coefficient of original VaR in historical simulation is larger than 1 while smaller than 1 in RiskMetrics. This implies that the estimation error of initial VaR models found in Figure 3 and 4 can be resolved by this feature. Since the original VaR in the historical simulation model was underestimated, the coefficients of the original VaR larger than 1 can adjust overall VaR higher. On the contrary, the coefficient of original VaR smaller than 1 in RiskMetrics enables to adjust overall VaR lower, which can alleviate overestimation.

In Figure 6, the new VaR from historical simulation and RiskMetrics model is repre- sented as a bold line in (a) and (b) respectively. The new VaR in both models clearly follows overall fluctuation more precisely than the original VaR represented as a dashed line. In his- torical simulation, the new VaR covers exceptionally large losses better with higher estimates.

RiskMetrics also shows better estimates for the same shock period with smaller VaR than the original one.

The number of exceedances attained by new VaR was 13 for historical simulation and 12 for RiskMetrics. The proportion of historical simulation decreased from 8.4% to 5.2% while RiskMetrics increased from 4.4% to 4.8%. Therefore, the new VaR for both cases became closer to the predetermined significance level of 5% than the original VaR.



The changes in coefficient of variables by the changes in λ of LASSO for the new VaR model are shown in Figure 7. For the new VaR model, λ was set to 0.1 for historical simulation and 0.3 for RiskMetrics.

Another new ten variables are found after LASSO regression3. The five post-selected variables in each new VaR model are following: The squared of 2nd, 3rd, 4th, 5th, 6th order lag of oil price for historical simulation; the squared of 3rd, 4th, 5th, 6th, 9th order lag of oil price for RiskMetrics. All the variables that return non-zero coefficient are turned out to be related to the oil price.

3see Table 3.





The p-values of the Wald test for the new VaR models were 0.023 for historical simula- tion and 0.068 for RiskMetrics. Hence, the null hypothesis of the historical simulation model after quantile regression is still rejected, while the RiskMetrics model is not rejected after quan- tile regression. Consequently, the new VaR model from the historical simulation is not correctly specified, however, the new VaR model from RiskMetrics is correctly specified.

V Conclusion

In this research, the application of quantile regression on the VaR model with post- selected variables through LASSO regression has been discussed. The original VaR estimates used for the basis of the initial VaR model were found via historical simulation and RiskMet- rics approach. Although the initial VaR models were constructed through selecting significant variables by LASSO among all candidates, both models turned out to be incorrectly specified by the post-selection inference.

To enhance the accuracy of the VaR model, new VaR was estimated by quantile regres- sion using the initial VaR models, including newly found regressors from LASSO. The new VaR estimates appeared to be more accurate than the original VaR since the new VaR follows the actual returns more precisely. Based on these new VaR estimates, the new VaR models were made and tested by the same procedure as the initial VaR model. According to the test results, the new VaR model from historical simulation was still incorrectly specified. However, the accuracy of the new model seems to be improved to some extent since the p-value of the Wald test increased. On the other hand, the new VaR model from RiskMetrics showed a more clear improvement with the p-value larger than the significant level of 5%, which means correctly specified.

Although the enhancement of accuracy of the VaR models has been verified, the his- torical simulation model needs to be correctly specified again, and further improvement also seems to be possible for RiskMetrics. Therefore, the whole VaR test process can be conducted again by tuning the hyperparameters of LASSO, such as degree of penalty λ, to select a differ- ent number of variables. Otherwise, another linear regression method for the VaR test, such as smoothly clipped absolute deviation (SCAD) proposed by Fan and Li (2001), can be employed to identify significant regressors in a different way for further research.




Benoit, D. F., & Van den Poel, D. (2009). Benefits of quantile regression for the analysis of customer lifetime value in a contractual setting: An application in financial services.

Expert Systems with Applications, 36(7), 10475-10484.

Berk, R., Brown, L., Buja, A., Zhang, K.,& Zhao, L. (2013). Valid post-selection inference.

The Annals of Statistics, 41(2), 802-837.

Bickel, P. J., Li, B., Tsybakov, A. B., van de Geer, S. A., Yu2, B., Valdés, T., ... & van der Vaart, A. (2006). Regularization in statistics. Test, 15(2), 271-344.

Bohdalová, M. (2007). A comparison of Value-at-Risk methods for measurement of the finan- cial risk. Faculty of Management, Comenius University, Bratislava, Slovakia, 10.

Christoffersen, P. F. (1998). Evaluating interval forecasts. International economic review, 841- 862.

Christoffersen, P. (2011). Elements of financial risk management. Academic Press.

Cont, R. (2007). Volatility clustering in financial markets: empirical facts and agent-based models. In Long memory in economics (pp. 289-309). Springer, Berlin, Heidelberg.

Duffie, D.,& Pan, J. (1997). An overview of value at risk. Journal of derivatives, 4(3), 7- 49.

Fan, J., & Li, R. (2001). Variable selection via nonconcave penalized likelihood and its ora- cle properties. Journal of the American statistical Association, 96(456), 1348-1360.



Federal Reserve Economic Data (FRED). (2021). Effective Federal Funds Rate (DFF). [Database].

Retrieved from:

Federal Reserve Economic Data (FRED). (2021). Unemployment Rate. [Database].

Retrieved from:

Federal Reserve Economic Data (FRED). (2021). 10-Year Breakeven Inflation Rate. [Database].

Retrieved from:

Hastie, T., Tibshirani, R., & Wainwright, M. (2019). Statistical learning with sparsity: the lasso and generalizations. Chapman and Hall/CRC.

Hull, J., & White, A. (1998). Incorporating volatility updating into the historical simulation method for value-at-risk. Journal of risk, 1(1), 5-19.

Hunter, J. S. (1986). The exponentially weighted moving average. Journal of quality tech- nology, 18(4), 203-210.

Inoue, A., Jin, L., & Rossi, B. (2017). Rolling window selection for out-of-sample forecasting with time-varying parameters. Journal of Econometrics, 196(1), 55-67.

Koenker, R., & Bassett Jr, G. (1978). Regression quantiles. Econometrica: journal of the Econometric Society, 33-50.

Koenker, R., & Hallock, K. F. (2001). Quantile regression. Journal of economic perspec- tives, 15(4), 143-156.

Li, M. (2015). Moving beyond the linear regression model: Advantages of the quantile re- gression model. Journal of Management, 41(1), 71-98.



Linsmeier, T. J., & Pearson, N. D. (2000). Value at risk. Financial Analysts Journal, 56(2), 47-67.

Lux, T., & Marchesi, M. (2000). Volatility clustering in financial markets: a microsimulation of interacting agents. International journal of theoretical and applied finance, 3(04), 675-702.

Macrotrends. (2021). WTI Crude Oil Prices - 10 Year Daily Chart. [Database].

Retrieved from: chart

Morgan, J. P. (1996). Riskmetrics technical document.

OFX. (2021). Historical Exchange Rates. [Database].

Retrieved from:

Tibshirani, R. (1996). Regression shrinkage and selection via the lasso. Journal of the Royal Statistical Society: Series B (Methodological), 58(1), 267-288.

Yahoo Finance. (2021). S&P 500 (GSPC). [Database].

Retrieved from:





Related subjects :