Range

PortfolioOptimisers.Range — Type
struct Range{__T_settings} <: RangeRiskMeasure

Measures the Range, the largest return of the sample minus the smallest one.

It is the WorstRealisation plus the largest return. It is the limit of ValueatRiskRange and of ConditionalValueatRiskRange as alpha and beta fall to zero, and the OrderedWeightsArray with the weights of owa_rg gives the same value. A sample of one observation, or of equal returns, has a Range of zero.

Mathematical definition

\[\begin{align} \mathrm{Range}(\boldsymbol{x}) &= \max_{1 \leq t \leq T} x_t - \min_{1 \leq t \leq T} x_t\,. \end{align}\]

Where:

  • $\mathrm{Range}(\boldsymbol{x})$: Full return spread of the portfolio.
  • $\boldsymbol{x}$: Portfolio returns vector $T \times 1$.
  • $T$: Number of observations.

Fields

  • settings: Risk measure settings.

Constructors

Range(;    settings::RiskMeasureSettings = RiskMeasureSettings()) -> Range

Keywords correspond to the struct's fields.

Functor

(r::Range)(x::VecNum)

Computes the Range of a portfolio returns vector x.

Arguments

  • x::VecNum: Portfolio returns vector.

Examples

julia> Range()Range  settings ┼ RiskMeasureSettings           │   scale ┼ Float64: 1.0           │      ub ┼ nothing           │     rke ┴ Bool: true

On the path of AverageDrawdown, the largest return is 0.375 and the smallest is $-0.25$.

julia> Range()([0.125, -0.25, 0.0625, -0.125, 0.375])0.625julia> Range()([-0.1])0.0

Related

References

  • [12] D. Cajas. Advanced Portfolio Optimization: A Cutting-edge Quantitative Approach (Springer Nature Switzerland, 2025). Section 7.2.3.1, Equation 7.73. The original source of this formulation was not found. The formulation follows this work and is not checked against the original.
source

References

[12]
D. Cajas. Advanced Portfolio Optimization: A Cutting-edge Quantitative Approach (Springer Nature Switzerland, 2025).