Skip to content
All library documents

Choosing the Correct Tail for Loss-Based Value at Risk

Article Quant Q&A · Author: user69062

Summary

The document asks how to calculate 95% Value at Risk from simulated portfolio losses sorted in ascending order. It proposes taking the 5th percentile and questions whether this selects the correct side, since the resulting figure is below the mean. The central issue is how the loss variable is defined and which tail represents adverse outcomes.

For nonnegative losses, a 95% confidence VaR is generally the 95th percentile of the loss distribution: only 5% of outcomes exceed it. The lower-tail quantile would instead make sense for returns or gains under a sign convention where losses are negative. The document provides a code snippet but no answer, validation, or details about the simulation or loss sign convention, so the correct quantile cannot be determined from the snippet alone.

Key ideas

  • VaR depends on whether the input variable represents losses or returns.
  • For nonnegative losses, the confidence-level quantile selects the adverse upper tail.
  • A lower-tail quantile may be appropriate when losses are represented as negative returns.
  • The document raises the tail-selection question but does not resolve it.

Tags

Full text
# How to calculate VaR on loss distribution


# How to calculate VaR on loss distribution












I sorted simulated portfolio losses in ascending order (sorted_losses variable). X-axis is loss, Y-axis probability of loss. I want to calculate 95% Value at risk in R. I used the below code, but am I choosing the correct side of distribution, because VaR value is lower than the mean?

```
confidence_level <- 0.95
var_95 <- quantile(sorted_losses, 1 - confidence_level)
cat("Value at Risk (VaR) at 95% confidence level:", var_95, "\n")
```

Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.