Range
PortfolioOptimisers.Range — Type
struct Range{__T_settings} <: RiskMeasureRepresents the Range risk measure.
Range computes the difference between the maximum and minimum portfolio returns, measuring the full spread of the return distribution. It is a simple measure of the total variability across all scenarios.
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()) -> RangeKeywords 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: trueRelated