@@ -13,7 +13,6 @@ def rangeOfRV (X : FinRV n ℚ) : Finset ℚ := Finset.univ.image X
1313
1414/-- Value-at-Risk of X at level α: VaR_α(X) = min { t ∈ X(Ω) | P[X ≤ t] ≥ α }.
1515If we assume 0 ≤ α ∧ α ≤ 1, then the "else 0" branch is never used. -/
16-
1716def VaR (P : Findist n) (X : FinRV n ℚ) (α : ℚ) : ℚ :=
1817 let S : Finset ℚ := (rangeOfRV X).filter (fun t => cdf P X t ≥ α)
1918 if h : S.Nonempty then
@@ -22,6 +21,9 @@ def VaR (P : Findist n) (X : FinRV n ℚ) (α : ℚ) : ℚ :=
2221 0
2322
2423notation "VaR[" α "," X "//" P "]" => VaR P X α
24+ -- TODO (Marek): What do you think about :
25+ -- notation "VaR[ X "//" P "," α "]" => VaR P X α
26+ -- I think that the α goes better with the probability that the variable
2527
2628theorem VaR_monotone (P : Findist n) (X Y : FinRV n ℚ) (α : ℚ)
2729 (hXY : ∀ ω, X ω ≤ Y ω) : VaR P X α ≤ VaR P Y α := by
@@ -66,6 +68,10 @@ def CVaR (P : Findist n) (X : FinRV n ℚ) (α : ℚ) : ℚ :=
6668 else
6769 num / den
6870
71+ -- NOTE (Marek): The CVaR, as defined above is not convex/concave.
72+ -- See Page 14 at https://www.cs.unh.edu/~mpetrik/pub/tutorials/risk2/dlrl2023.pdf
73+ -- NOTE (Marek): The CVaR above is defined for costs and not rewards
74+
6975notation "CVaR[" α "," X "//" P "]" => CVaR P X α
7076
7177--TODO: prove...
@@ -75,4 +81,5 @@ notation "CVaR[" α "," X "//" P "]" => CVaR P X α
7581-- convexity
7682-- CVaR ≥ VaR: CVaR[α, X // P] ≥ VaR[α, X // P]
7783
84+
7885end Risk
0 commit comments