--- title: es description: This documentation page provides guidance on how to use the Expected Shortfall (ES) function of the selected portfolio. It includes its usage, parameters including distribution and percentile, and examples. keywords: - Expected Shortfall - ES function - portfolio - parameters - distribution - percentile - portfolio return - mean of portfolios --- import HeadTitle from '@site/src/components/General/HeadTitle.tsx'; Provides Expected Shortfall (short: ES) of the selected portfolio. ### Usage ```python es [-m] [-d DIST] [-p PERCENTILE] ``` --- ## Parameters | Name | Description | Default | Optional | Choices | | ---- | ----------- | ------- | -------- | ------- | | use_mean | If one should use the mean of the portfolios return | True | True | None | | distribution | Distribution used for the calculations | normal | True | laplace, student_t, logistic, normal | | percentile | Percentile used for ES calculations, for example input 99.9 equals a 99.9 Percent Expected Shortfall | 99.9 | True | None | --- ## Examples ```python 2022 Feb 25, 03:09 (๐Ÿฆ‹) /portfolio/ $ es Portfolio Expected Shortfall โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”“ โ”ƒ โ”ƒ ES: โ”ƒ Historical ES: โ”ƒ โ”กโ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‡โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ฉ โ”‚ 90.0% โ”‚ -0.0204 โ”‚ -0.0202 โ”‚ โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ”‚ 95.0% โ”‚ -0.0240 โ”‚ -0.0242 โ”‚ โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ”‚ 99.0% โ”‚ -0.0310 โ”‚ -0.0270 โ”‚ โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ”‚ 99.9% โ”‚ -0.0391 โ”‚ -0.0277 โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ ``` ---