function paramcondvar
paramcondvar(
mu: number,
sigma: number,
p?: number,
amount?: number,
period?: number,
): number

Parametric Conditional Value-At-Risk.

Parametric Conditional Value-At-Risk measures the expected loss exceeding the VaR. Also known as Expected Shortfall (ES) or Expected Tail Loss (ETL). It is more sensitive to the shape of the loss distribution in the tails.

Examples

Parametric daily CVaR with mean and std

import { assertEquals } from "jsr:@std/assert";

assertEquals(paramcondvar(0.0179, 0.023230487630602065), 0.030017825479120894);

Parametric CVaR with additional parameters

import { assertEquals } from "jsr:@std/assert";

assertEquals(paramcondvar(0.0179, 0.023230487630602065, 0.99, 100000, 10), 19578.980844416896);

Different asset parameters

import { assertEquals } from "jsr:@std/assert";

assertEquals(paramcondvar(0.01125, 0.04727061065899899, 0.99, 100000, 10), 39840.35893323986);

Parameters

mu: number

mean value (def: 0)

sigma: number

standard deviation (def: 1)

optional
p: number

cVaR confidence level in range [0,1] (def: 0.95)

optional
amount: number

portfolio/asset amount (def: 1)

optional
period: number

time horizon (def: 1)

Return Type

number

Parametric Conditional Value-At-Risk

paramcondvar(
mu: array,
sigma: array,
p?: number,
amount?: number,
period?: number,
): array

Parametric Conditional Value-At-Risk.

Parametric Conditional Value-At-Risk measures the expected loss exceeding the VaR. Also known as Expected Shortfall (ES) or Expected Tail Loss (ETL). It is more sensitive to the shape of the loss distribution in the tails.

Examples

Parametric daily CVaR with mean and std

import { assertEquals } from "jsr:@std/assert";

assertEquals(paramcondvar(0.0179, 0.023230487630602065), 0.030017825479120894);

Parametric CVaR with additional parameters

import { assertEquals } from "jsr:@std/assert";

assertEquals(paramcondvar(0.0179, 0.023230487630602065, 0.99, 100000, 10), 19578.980844416896);

Different asset parameters

import { assertEquals } from "jsr:@std/assert";

assertEquals(paramcondvar(0.01125, 0.04727061065899899, 0.99, 100000, 10), 39840.35893323986);

Parameters

mean value (def: 0)

sigma: array

standard deviation (def: 1)

optional
p: number

cVaR confidence level in range [0,1] (def: 0.95)

optional
amount: number

portfolio/asset amount (def: 1)

optional
period: number

time horizon (def: 1)

Return Type

Parametric Conditional Value-At-Risk

paramcondvar(
mu: matrix,
sigma: matrix,
p?: number,
amount?: number,
period?: number,
): array | matrix

Parametric Conditional Value-At-Risk.

Parametric Conditional Value-At-Risk measures the expected loss exceeding the VaR. Also known as Expected Shortfall (ES) or Expected Tail Loss (ETL). It is more sensitive to the shape of the loss distribution in the tails.

Examples

Parametric daily CVaR with mean and std

import { assertEquals } from "jsr:@std/assert";

assertEquals(paramcondvar(0.0179, 0.023230487630602065), 0.030017825479120894);

Parametric CVaR with additional parameters

import { assertEquals } from "jsr:@std/assert";

assertEquals(paramcondvar(0.0179, 0.023230487630602065, 0.99, 100000, 10), 19578.980844416896);

Different asset parameters

import { assertEquals } from "jsr:@std/assert";

assertEquals(paramcondvar(0.01125, 0.04727061065899899, 0.99, 100000, 10), 39840.35893323986);

Parameters

mean value (def: 0)

sigma: matrix

standard deviation (def: 1)

optional
p: number

cVaR confidence level in range [0,1] (def: 0.95)

optional
amount: number

portfolio/asset amount (def: 1)

optional
period: number

time horizon (def: 1)

Return Type

Parametric Conditional Value-At-Risk