Kurtosis
PortfolioOptimisers.Kurtosis — Type
struct Kurtosis{__T_settings, __T_w, __T_mu, __T_kt, __T_N, __T_alg1, __T_alg2, __T_pe} <: RiskMeasureRepresents the square root kurtosis risk measure.
Computes portfolio risk as the square root of the fourth central moment (kurtosis) of the return distribution, optionally using custom weights, expected returns, and a kurtosis (fourth moment) matrix. This risk measure can be evaluated using either the full or semi (downside) deviations, depending on the algorithm provided.
Mathematical definition
Let $\boldsymbol{x} = \mathbf{X} \boldsymbol{w}$ be the $T \times 1$ vector of portfolio returns, and let $\mu$ be the chosen centre (mean, weighted mean, or user-supplied value). Define the centred deviations:
\[\begin{align} \delta_t &= x_t - \mu\,. \end{align}\]
The fourth central moment (full moment) is:
\[\begin{align} m_4(\boldsymbol{w}) &= \frac{1}{T} \sum_{t=1}^{T} \delta_t^4\,. \end{align}\]
The same quantity in the $N^2 \times N^2$ cokurtosis matrix $\hat{\mathbf{K}}$, with the Kronecker product $\otimes$, is:
\[\begin{align} m_4(\boldsymbol{w}) &= (\boldsymbol{w}^\intercal \otimes \boldsymbol{w}^\intercal)\, \hat{\mathbf{K}}\, (\boldsymbol{w} \otimes \boldsymbol{w})\,. \end{align}\]
For the semi (downside) variant, only non-positive deviations contribute:
\[\begin{align} m_4^{-}(\boldsymbol{w}) &= \frac{1}{T} \sum_{t=1}^{T} \min(\delta_t, 0)^4\,. \end{align}\]
The risk is the fourth moment itself under a quadratic formulation, and its square root under a second-order cone formulation. alg2 selects between them, and alg1 selects between the full and the semi moment:
\[\begin{align} \mathrm{Kurt}(\boldsymbol{w}) &= \begin{cases} \sqrt{m_4(\boldsymbol{w})} & \text{(\texttt{SOCRiskExpr})} \\ m_4(\boldsymbol{w}) & \text{(quadratic formulation)} \end{cases}\,. \end{align}\]
Where:
- $\boldsymbol{w}$: Portfolio weights vector $N \times 1$.
- $\mathbf{X}$: $T \times N$ asset returns matrix.
- $T$: Number of observations.
- $\delta_t$: Centred portfolio return at period $t$.
- $\hat{\mathbf{K}}$: $N^2 \times N^2$ cokurtosis matrix.
- $\otimes$: Kronecker product.
Fields
settings: Risk measure settings.
w: Optional observation weights vectorobservations × 1, or a concrete subtype ofDynamicAbstractWeights. Ifnothing, the computation is unweighted.
mu: Optional centre the moment is taken about, a scalar or a vectorassets × 1. Also admits a Deferred Quantity — an expected returns estimator or a prior estimator that computes the centre against the optimisation's own prior, atfactorytime (seeMuSlotandresolve_deferred_quantities). Ifnothing, the prior supplies it.
kt: Optional cokurtosis matrixassets^2 × assets^2. Also admits a Deferred Quantity — a cokurtosis estimator or a prior estimator that computes the matrix against the optimisation's own prior, atfactorytime (seeKtSlotandresolve_deferred_quantities). A cokurtosis estimator suppliesmuas well, from its ownme, so that the tensor and the centre it was taken about come out of one object. Ifnothing, the prior supplies it.
N: Optional number of eigenvalues per asset for the approximate cokurtosis formulation.
alg1: First algorithm variant.
alg2: Second algorithm variant.
pe: Optional prior estimator that fills every prior-derived slot the measure leaves unstated, from a single fit. A stated slot wins. Seeresolve_deferred_quantities.
Constructors
Kurtosis(; settings::RiskMeasureSettings = RiskMeasureSettings(), w::Option{<:ObsWeights} = nothing, mu::Option{<:MuSlot} = nothing, kt::Option{<:KtSlot} = nothing, N::Option{<:Integer} = nothing, alg1::AbstractMomentAlgorithm = FullMoment(), alg2::SecondMomentFormulation = SOCRiskExpr(), pe::Option{<:AbstractPriorEstimator} = nothing,) -> KurtosisKeywords correspond to the struct's fields.
Validation
If
muis notnothing:::Number:isfinite(mu).::VecNum:!isempty(mu)andall(isfinite, mu).
If
wis notnothing,!isempty(w).If
ktis notnothing:!isempty(kt)andsize(kt, 1) == size(kt, 2).If
muis notnothing:::VecNum:length(mu)^2 == size(kt, 1).::VecScalar:length(mu.v)^2 == size(kt, 1).
If
Nis notnothing: must be positive.
mu and kt are stated independently, so nothing makes them agree with each other. A caller who wants one consistent set names pe alone and lets it fill both from a single fit. A caller who states them by hand must make sure that they agree.
kt also admits a CokurtosisEstimator or an AbstractPriorEstimator, and mu an AbstractExpectedReturnsEstimator or an AbstractPriorEstimator. Either is resolved against the optimisation's own prior — see resolve_deferred_quantities. A cokurtosis estimator in kt also supplies mu from its own me, so that the tensor and the centre it was taken about come out of one object. A deferred slot wins over pe.
JuMP Formulations
Exact
This formulation is used when N is nothing. It is the parametric model of [30].
Approximate
This formulation is used when N is an integer, the larger the value of N, the more accurate and expensive it becomes. It is the sum-of-squared-quadratic-forms model of [101].
Examples
julia> Kurtosis()Kurtosis settings ┼ RiskMeasureSettings │ scale ┼ Float64: 1.0 │ ub ┼ nothing │ rke ┴ Bool: true w ┼ nothing mu ┼ nothing kt ┼ nothing N ┼ nothing alg1 ┼ FullMoment() alg2 ┼ SOCRiskExpr() pe ┴ nothingRelated
RiskMeasureRiskMeasureSettingsFullMomentSemiMomentHighOrderPriorLowOrderPriorSOCRiskExprQuadSecondMomentFormulationsNegativeSkewnessresolve_deferred_quantitiesexpected_risk
References
PortfolioOptimisers.factory — Method
factory(
r::Kurtosis,
pr::HighOrderPrior,
args...;
kwargs...
) -> Kurtosis{RiskMeasureSettings{__T_scale, __T_ub, __T_rke}, _A, _B, _C, _D, <:AbstractMomentAlgorithm, <:SecondMomentFormulation, Nothing} where {__T_scale, __T_ub, __T_rke, _A, _B, _C, _D}
Create an instance of Kurtosis by selecting the cokurtosis matrix, expected returns, and weights from the risk-measure instance or falling back to a HighOrderPrior result.
Related
PortfolioOptimisers.factory — Method
factory(
r::Kurtosis,
pr::LowOrderPrior,
args...;
kwargs...
) -> Kurtosis{RiskMeasureSettings{__T_scale, __T_ub, __T_rke}, _A, _B, _C, _D, <:AbstractMomentAlgorithm, <:SecondMomentFormulation, Nothing} where {__T_scale, __T_ub, __T_rke, _A, _B, _C, _D}
Create an instance of Kurtosis from a LowOrderPrior result (cokurtosis matrix is not used).
Related
PortfolioOptimisers.port_opt_view — Method
port_opt_view(
r::Kurtosis,
i,
args...
) -> Kurtosis{RiskMeasureSettings{__T_scale, __T_ub, __T_rke}, _A, _B, _C, _D, <:AbstractMomentAlgorithm, <:SecondMomentFormulation} where {__T_scale, __T_ub, __T_rke, _A, _B, _C, _D}
Return a view of Kurtosis r sliced to asset indices i.
Slices both the cokurtosis matrix kt and the expected returns mu for cluster-based optimisation.
Related
References
- [30]
- D. Cajas. Convex Optimization of Portfolio Kurtosis. Available at SSRN 4202967 (2022).
- [101]
- D. Cajas. Approximation of Portfolio Kurtosis through Sum of Squared Quadratic Forms. Available at SSRN 4472793 (2023).