{"id":1462,"date":"2021-10-26T11:58:24","date_gmt":"2021-10-26T11:58:24","guid":{"rendered":"https:\/\/www.theirmindia.org\/blog\/?p=1462"},"modified":"2026-01-23T19:32:05","modified_gmt":"2026-01-23T19:32:05","slug":"quantifying-risk-in-finance-expected-shortfalles-or-value-at-riskvar","status":"publish","type":"post","link":"https:\/\/www.theirmindia.org\/blog\/quantifying-risk-in-finance-expected-shortfalles-or-value-at-riskvar\/","title":{"rendered":"Quantifying Risk in Finance: Expected Shortfall(ES) or Value at Risk(VaR)?\u00a0"},"content":{"rendered":"<p><a href=\"https:\/\/www.theirmindia.org\/certification-track\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-5040\" src=\"https:\/\/www.theirmindia.org\/blog\/wp-content\/uploads\/2025\/11\/blog-image-300x74.png\" alt=\"Getting India Risk Ready\" width=\"668\" height=\"166\" srcset=\"https:\/\/www.theirmindia.org\/blog\/wp-content\/uploads\/2025\/11\/blog-image-300x74.png 300w, https:\/\/www.theirmindia.org\/blog\/wp-content\/uploads\/2025\/11\/blog-image-768x191.png 768w, https:\/\/www.theirmindia.org\/blog\/wp-content\/uploads\/2025\/11\/blog-image.png 1024w\" sizes=\"auto, (max-width: 668px) 100vw, 668px\" \/><\/a><\/p>\n<p>Value At Risk, abbreviated as VaR, and Expected Shortfall, abbreviated as ES are common terms that one would usually come across in <a href=\"https:\/\/www.theirmindia.org\/level1\">measuring risk in finance<\/a>.<\/p>\n<p>We all want to make money but we don\u2019t want to make rash decisions in doing so! In other words, we want to maximise our returns and minimise our risk.\u00a0We intuitively understand these concepts, but how do we study these concepts from finance mathematically?<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1463\" src=\"https:\/\/www.theirmindia.org\/blog\/wp-content\/uploads\/2021\/10\/1-300x112.png\" alt=\"\" width=\"431\" height=\"161\" srcset=\"https:\/\/www.theirmindia.org\/blog\/wp-content\/uploads\/2021\/10\/1-300x112.png 300w, https:\/\/www.theirmindia.org\/blog\/wp-content\/uploads\/2021\/10\/1.png 678w\" sizes=\"auto, (max-width: 431px) 100vw, 431px\" \/><\/p>\n<p>Let us say we have a probability distribution of our returns as follows. The y-axis is the probability while the x-axis is the returns. We see that our distribution has a peak at 0 and this tells us that the most likely outcome is that we neither make money nor lose money. It also tells us that we have a 50% probability to lose money and a 50% probability to make money. It also (if you\u2019re a mathematician reading this, please pardon me for skipping the measure theory tit-bits!).<\/p>\n<p>Now anyone would love to make a lot of money, but we notice from the distribution that this outcome, sadly, has a very low probability and is hence very unlikely! However, most people are more concerned with not losing their money compared to making a lot of money. Hence it is important to quantify how much money we stand to lose!<\/p>\n<p>We first select and fix a significance level \u03b1 or confidence level, (1-\u03b1)%. The more brave an individual is to face the risk of losing money, the lower is the \u03b1. Statisticians generally use an \u03b1=0.05 empirically.<\/p>\n<p>Let us first understand the concept of Value at Risk or VaR.<\/p>\n<p><strong>Value At Risk<\/strong> <strong>is a measure of the potential losses that one could face.<\/strong> It answers the simple question, what is the minimum loss over the whole range of outcomes in the \u03b1% tail where I stand to lose? Graphically, it means the value at which the area under the curve sums up to \u03b1.<\/p>\n<p>The VaR refers to a <em>quantile. <\/em>For an \u03b1 = 0.05, we are interested in the 5% quantile of our returns\u2014meaning that 95% of our returns are greater than the VaR, while 5% are to the left and hence lesser than the VaR. The smaller \u03b1 is chosen, the further left on the distribution we are, and the more negative our VaR becomes.<\/p>\n<p>Expected Shortfall or ES answers a different question:<\/p>\n<p>What is the mean of the losses that I could face, over the tail that I stand to lose? <strong>Expected Shortfall R<\/strong><strong>isk Measure<\/strong>, is a measure of the average losses over the \u03b1% losing tail.<\/p>\n<p>Expected Shortfall, a concept used in the field of <em><strong><a href=\"https:\/\/www.theirmindia.org\/level2\">financial risk management<\/a><\/strong><\/em> takes the average of all the returns <em>to the left <\/em>of the VaR i.e. the returns which are less than the VaR. Since it is an expectation and is calculated by integrating over an entire region, it is a much more robust statistic compared to VaR which is just a single value.<\/p>\n<p>Now, which one should we use for quantifying risk? Well, it depends! If you want to hate risks, use VaR. If you are a person who wants long-term returns, use ES!<\/p>\n<p><strong>Experimenting with data in R!\u00a0<\/strong><\/p>\n<p>R is an awesome language for quantitative finance and computation risk assessment. Let us now apply what we learnt on a real data set on R! We choose the Wilshire 5000 dataset and our period of study. Don\u2019t worry if you\u2019ve never used R, I\u2019ve added plenty of comments with the code so you can follow along and understand!<\/p>\n<table width=\"602\">\n<tbody>\n<tr>\n<td width=\"602\"># Import libraries and set seed<br \/>\nlibrary(quantmod);<br \/>\nlibrary(ggplot2);<br \/>\nlibrary(moments);<br \/>\nlibrary(MASS);<br \/>\nlibrary(metRology)<br \/>\nset.seed(1)<br \/>\n# Get Wilshire 5000 data<br \/>\nwilshire &lt;- getSymbols(Symbols = &#8220;WILL5000IND&#8221;, src = &#8220;FRED&#8221;, auto.assign = FALSE)<br \/>\nwilshire &lt;- na.omit(wilshire)<br \/>\nwilshire &lt;- wilshire[&#8220;1980-01-01\/2020-06-01&#8221;]# Let us see what our data looks like!# Create time series plot of data<br \/>\nggplot(data = wilshire, aes(x = Index, y = WILL5000IND))+ geom_line(size = 1.0) + xlab(&#8220;&#8221;) + ylab(&#8220;&#8221;) + ggtitle(&#8220;Wilshire 5000 Index&#8221;)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1464\" src=\"https:\/\/www.theirmindia.org\/blog\/wp-content\/uploads\/2021\/10\/2-300x160.png\" alt=\"\" width=\"469\" height=\"250\" srcset=\"https:\/\/www.theirmindia.org\/blog\/wp-content\/uploads\/2021\/10\/2-300x160.png 300w, https:\/\/www.theirmindia.org\/blog\/wp-content\/uploads\/2021\/10\/2-20x10.png 20w, https:\/\/www.theirmindia.org\/blog\/wp-content\/uploads\/2021\/10\/2-30x17.png 30w, https:\/\/www.theirmindia.org\/blog\/wp-content\/uploads\/2021\/10\/2-75x40.png 75w, https:\/\/www.theirmindia.org\/blog\/wp-content\/uploads\/2021\/10\/2.png 393w\" sizes=\"auto, (max-width: 469px) 100vw, 469px\" \/><\/p>\n<table width=\"602\">\n<tbody>\n<tr>\n<td width=\"602\">log_returns &lt;- diff(log(wilshire))[-1]<br \/>\n# We calculate daily log returns instead of simple daily returns because# most of such data follow a right-skewed distribution which can be# approximated quite well by a log-normal distribution. A log-normal# distribution has a useful property that its log is normally distributed # which is quite easy to work with.<br \/>\nmu &lt;- round(mean(log_returns), 6) # Mean: 0.000428<br \/>\nsigma &lt;- round(sd(log_returns), 6) # Standard Deviation: 0.011063<\/p>\n<p># Produce histogram of returns overlaid with a kernel density plot ggplot(data = log_returns, aes(x = WILL5000IND))<\/p>\n<p>+ geom_histogram(aes(y = ..density..), binwidth = 0.01, color = &#8220;black&#8221;,<br \/>\nfill = &#8220;lightblue&#8221;)<\/p>\n<p>+ geom_density(size = 0.3) + xlab(&#8220;Daily Log Returns&#8221;)<\/p>\n<p>+ ggtitle(&#8220;Wilshire 5000 Index&#8221;, subtitle = &#8220;Mean = 0.000428, Std. Deviation = 0.011063&#8221;)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1465\" src=\"https:\/\/www.theirmindia.org\/blog\/wp-content\/uploads\/2021\/10\/3-300x170.png\" alt=\"\" width=\"443\" height=\"251\" srcset=\"https:\/\/www.theirmindia.org\/blog\/wp-content\/uploads\/2021\/10\/3-300x170.png 300w, https:\/\/www.theirmindia.org\/blog\/wp-content\/uploads\/2021\/10\/3-20x10.png 20w, https:\/\/www.theirmindia.org\/blog\/wp-content\/uploads\/2021\/10\/3-30x17.png 30w, https:\/\/www.theirmindia.org\/blog\/wp-content\/uploads\/2021\/10\/3.png 460w\" sizes=\"auto, (max-width: 443px) 100vw, 443px\" \/><\/p>\n<table width=\"602\">\n<tbody>\n<tr>\n<td width=\"602\"># Print skewness and kurtosis<br \/>\ncat(&#8220;Skewness:&#8221;, skewness(log_returns),<br \/>\n&#8220;Kurtosis:&#8221;, kurtosis(log_returns),<br \/>\nsep = &#8220;\\n&#8221;)<br \/>\nWe now estimate the VaR and ES using an empirical distribution- we simulate directly from our empirical distribution without making any assumptions about its shape.<br \/>\n# Set a 95% confidence level<br \/>\nalpha &lt;- 0.05<br \/>\n# Random sample of 100,000 observations from the empirical distribution with replacement<br \/>\nsample.empirical &lt;- sample(as.vector(log_returns), 1000000, replace = TRUE)<br \/>\n# Calculate VaR<br \/>\nVaR.empirical &lt;- round(quantile(log_returns, alpha), 6)<br \/>\n# Calculate ES<br \/>\nES.empirical &lt;- round(mean(sample.empirical[sample.empirical &lt; VaR.empirical]), 6)<br \/>\n# Print results<br \/>\ncat(&#8220;Value at Risk:&#8221;, VaR.empirical, &#8220;Expected Shortfall:&#8221;, ES.empirical, sep = &#8220;\\n&#8221;)<br \/>\nAnd we now finally find the VaR and ES of the portfolio using the empirical distribution<br \/>\nportfolio &lt;- 1000<br \/>\n# Using VaR and ES from empirical distribution<br \/>\nVaR.portfolio &lt;- portfolio * (exp(VaR.empirical) &#8211; 1)<br \/>\nES.portfolio &lt;- portfolio * (exp(ES.empirical) &#8211; 1)<br \/>\n# Print results<br \/>\ncat(&#8220;Value at Risk:&#8221;, VaR.portfolio, &#8220;Expected Shortfall:&#8221;, ES.portfolio, sep = &#8220;\\n&#8221;)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Hope this article gives you a comprehensive understanding of these two important statistics in measuring financial risk analytics!<\/p>\n<p><strong>References<\/strong><\/p>\n<p>Image Source- <a href=\"https:\/\/www.researchgate.net\/publication\/322701819_Transfer_and_Generalisation_of_Financial_Risk_Metrics_to_Discrete_Event_Simulation\">https:\/\/www.researchgate.net\/publication\/322701819_Transfer_and_Generalisation_of_Financial_Risk_Metrics_to_Discrete_Event_Simulation<\/a><\/p>\n<p><strong>Blog Published By: Mr. Ananyapam, Student Risk Committee Member<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Value At Risk, abbreviated as VaR, and Expected Shortfall, abbreviated as ES are common terms that one would usually come across in measuring risk in finance. We all want to make money but we don\u2019t want to make rash decisions in doing so! In other words, we want to maximise our returns and minimise our risk.\u00a0We intuitively understand these concepts, but how do we study these concepts from finance mathematically? Let us say we have a probability distribution of our returns as follows. The y-axis is the probability while the x-axis is the returns. We see that our distribution has [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1468,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[44],"tags":[],"class_list":["post-1462","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-sector-risks"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v15.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Quantifying Risk in Finance: Expected Shortfall(ES) or Value at Risk(VaR)?\u00a0 - IRM India Affiliate<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.theirmindia.org\/blog\/quantifying-risk-in-finance-expected-shortfalles-or-value-at-riskvar\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Quantifying Risk in Finance: Expected Shortfall(ES) or Value at Risk(VaR)?\u00a0 - IRM India Affiliate\" \/>\n<meta property=\"og:description\" content=\"Value At Risk, abbreviated as VaR, and Expected Shortfall, abbreviated as ES are common terms that one would usually come across in measuring risk in finance. We all want to make money but we don\u2019t want to make rash decisions in doing so! In other words, we want to maximise our returns and minimise our risk.\u00a0We intuitively understand these concepts, but how do we study these concepts from finance mathematically? Let us say we have a probability distribution of our returns as follows. The y-axis is the probability while the x-axis is the returns. We see that our distribution has [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.theirmindia.org\/blog\/quantifying-risk-in-finance-expected-shortfalles-or-value-at-riskvar\/\" \/>\n<meta property=\"og:site_name\" content=\"IRM India Affiliate\" \/>\n<meta property=\"article:published_time\" content=\"2021-10-26T11:58:24+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-01-23T19:32:05+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.theirmindia.org\/blog\/wp-content\/uploads\/2021\/10\/risk-in-finance-1.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"551\" \/>\n\t<meta property=\"og:image:height\" content=\"132\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\">\n\t<meta name=\"twitter:data1\" content=\"4 minutes\">\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.theirmindia.org\/blog\/#website\",\"url\":\"https:\/\/www.theirmindia.org\/blog\/\",\"name\":\"IRM India Affiliate\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":\"https:\/\/www.theirmindia.org\/blog\/?s={search_term_string}\",\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/www.theirmindia.org\/blog\/quantifying-risk-in-finance-expected-shortfalles-or-value-at-riskvar\/#primaryimage\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/www.theirmindia.org\/blog\/wp-content\/uploads\/2021\/10\/risk-in-finance-1.jpg\",\"width\":551,\"height\":132},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.theirmindia.org\/blog\/quantifying-risk-in-finance-expected-shortfalles-or-value-at-riskvar\/#webpage\",\"url\":\"https:\/\/www.theirmindia.org\/blog\/quantifying-risk-in-finance-expected-shortfalles-or-value-at-riskvar\/\",\"name\":\"Quantifying Risk in Finance: Expected Shortfall(ES) or Value at Risk(VaR)?\\u00a0 - IRM India Affiliate\",\"isPartOf\":{\"@id\":\"https:\/\/www.theirmindia.org\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.theirmindia.org\/blog\/quantifying-risk-in-finance-expected-shortfalles-or-value-at-riskvar\/#primaryimage\"},\"datePublished\":\"2021-10-26T11:58:24+00:00\",\"dateModified\":\"2026-01-23T19:32:05+00:00\",\"author\":{\"@id\":\"https:\/\/www.theirmindia.org\/blog\/#\/schema\/person\/e2c7c644f5ba4e6cd8025627f87412cf\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.theirmindia.org\/blog\/quantifying-risk-in-finance-expected-shortfalles-or-value-at-riskvar\/\"]}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.theirmindia.org\/blog\/#\/schema\/person\/e2c7c644f5ba4e6cd8025627f87412cf\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/www.theirmindia.org\/blog\/#personlogo\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/ae9be992eb4ae7b97cc78b5d1c9e2f232db61cbdd191d14a1ee7639e2c4ba1fa?s=96&d=mm&r=g\",\"caption\":\"admin\"},\"sameAs\":[\"https:\/\/www.theirmindia.org\/blog\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","_links":{"self":[{"href":"https:\/\/www.theirmindia.org\/blog\/wp-json\/wp\/v2\/posts\/1462","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.theirmindia.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.theirmindia.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.theirmindia.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.theirmindia.org\/blog\/wp-json\/wp\/v2\/comments?post=1462"}],"version-history":[{"count":5,"href":"https:\/\/www.theirmindia.org\/blog\/wp-json\/wp\/v2\/posts\/1462\/revisions"}],"predecessor-version":[{"id":5972,"href":"https:\/\/www.theirmindia.org\/blog\/wp-json\/wp\/v2\/posts\/1462\/revisions\/5972"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.theirmindia.org\/blog\/wp-json\/wp\/v2\/media\/1468"}],"wp:attachment":[{"href":"https:\/\/www.theirmindia.org\/blog\/wp-json\/wp\/v2\/media?parent=1462"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.theirmindia.org\/blog\/wp-json\/wp\/v2\/categories?post=1462"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.theirmindia.org\/blog\/wp-json\/wp\/v2\/tags?post=1462"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}