Cokurtosis
PortfolioOptimisers.CokurtosisEstimator
— Typeabstract type CokurtosisEstimator <: AbstractEstimator end
Abstract supertype for all cokurtosis estimators in PortfolioOptimisers.jl.
All concrete types implementing cokurtosis estimation algorithms should subtype CokurtosisEstimator
. This enables a consistent interface for cokurtosis-based higher moment estimators throughout the package.
Related
PortfolioOptimisers.Cokurtosis
— Typestruct Cokurtosis{T1, T2, T3} <: CokurtosisEstimator
me::T1
mp::T2
alg::T3
end
Container type for cokurtosis estimators.
Cokurtosis
encapsulates the mean estimator, matrix processing estimator, and moment algorithm for cokurtosis estimation. This enables modular workflows for higher-moment portfolio analysis.
Fields
me::AbstractExpectedReturnsEstimator
: Mean estimator for expected returns.mp::AbstractMatrixProcessingEstimator
: Matrix processing estimator for cokurtosis tensors.alg::AbstractMomentAlgorithm
: Moment algorithm.
Constructor
Cokurtosis(; me::AbstractExpectedReturnsEstimator = SimpleExpectedReturns(),
mp::AbstractMatrixProcessingEstimator = DefaultMatrixProcessing(),
alg::AbstractMomentAlgorithm = Full())
Construct a Cokurtosis
estimator with the specified mean estimator, matrix processing estimator, and moment algorithm.
Related
PortfolioOptimisers.Cokurtosis
— MethodCokurtosis(; me::AbstractExpectedReturnsEstimator = SimpleExpectedReturns(),
mp::AbstractMatrixProcessingEstimator = DefaultMatrixProcessing(),
alg::AbstractMomentAlgorithm = Full())
Construct a Cokurtosis
estimator for cokurtosis computation.
Arguments
me::AbstractExpectedReturnsEstimator
: Mean estimator for expected returns.mp::AbstractMatrixProcessingEstimator
: Matrix processing estimator.alg::AbstractMomentAlgorithm
: Moment algorithm.
ReturnsResult
Cokurtosis
: Configured cokurtosis estimator.
Examples
julia> Cokurtosis()
Cokurtosis
me | SimpleExpectedReturns
| w | nothing
mp | DefaultMatrixProcessing
| pdm | Posdef
| | alg | UnionAll: NearestCorrelationMatrix.Newton
| denoise | nothing
| detone | nothing
| alg | nothing
alg | Full()
Related
PortfolioOptimisers._cokurtosis
— Function_cokurtosis(X::AbstractMatrix, mp::AbstractMatrixProcessingEstimator)
Internal helper for cokurtosis computation.
_cokurtosis
computes the cokurtosis tensor for the input data matrix and applies matrix processing using the specified estimator.
Arguments
X::AbstractMatrix
: Data matrix (observations × assets).mp::AbstractMatrixProcessingEstimator
: Matrix processing estimator.
ReturnsResult
ckurt::Matrix
: Cokurtosis tensor after matrix processing.
Related
PortfolioOptimisers.cokurtosis
— Functioncokurtosis(ke::Cokurtosis{<:Any, <:Any, <:Full}, X::AbstractMatrix; dims::Int = 1, mean = nothing, kwargs...)
cokurtosis(ke::Cokurtosis{<:Any, <:Any, <:Semi}, X::AbstractMatrix; dims::Int = 1, mean = nothing, kwargs...)
cokurtosis(::Nothing, args...; kwargs...)
Compute the cokurtosis tensor for a dataset.
This method computes the cokurtosis tensor using the estimator's mean and matrix processing algorithm. For Full
, it uses all centered data; for Semi
, it uses only negative deviations. If the estimator is nothing
, returns nothing
.
Arguments
ke::Cokurtosis{<:Any, <:Any, <:Full}
: Cokurtosis estimator withFull
moment algorithm.ke::Cokurtosis{<:Any, <:Any, <:Semi}
: Cokurtosis estimator withSemi
moment algorithm.ke::Nothing
: No-op cokurtosis computation, returnsnothing
.X::AbstractMatrix
: Data matrix (observations × assets).dims::Int
: Dimension along which to compute the mean.mean
: Optional mean vector. If not provided, computed using the estimator's mean estimator.kwargs...
: Additional keyword arguments passed to the mean estimator.
ReturnsResult
ckurt::Matrix
: Cokurtosis tensor (assets^2 × assets^2).
Examples
julia> using StableRNGs
julia> rng = StableRNG(123456789);
julia> X = randn(rng, 10, 2);
julia> cokurtosis(Cokurtosis(), X)
4×4 Matrix{Float64}:
1.33947 -0.246726 -0.246726 0.493008
-0.246726 0.493008 0.493008 -0.201444
-0.246726 0.493008 0.493008 -0.201444
0.493008 -0.201444 -0.201444 0.300335
Related