Compact Uncertainty Sets: private API
PortfolioOptimisers.expand_investable_ucs — Method
expand_investable_ucs(
set::CompactCovarianceUncertaintySet,
imsk::BitVector,
pr::AbstractPriorResult
) -> Union{CompactCovarianceUncertaintySet{var"#s185", var"#s1851", var"#s1852", <:AbstractMatrix{var"#s166"}, Nothing} where {var"#s185"<:Number, var"#s166"<:Union{Number, AbstractJuMPScalar}, var"#s1851"<:AbstractVector{var"#s166"}, var"#s166"<:Union{Number, AbstractJuMPScalar}, var"#s1852"<:AbstractMatrix{var"#s166"}, var"#s166"<:Union{Number, AbstractJuMPScalar}}, CompactCovarianceUncertaintySet{var"#s185", var"#s1851", var"#s1852", var"#s1853", <:AbstractMatrix{var"#s166"}} where {var"#s185"<:Number, var"#s166"<:Union{Number, AbstractJuMPScalar}, var"#s1851"<:AbstractVector{var"#s166"}, var"#s166"<:Union{Number, AbstractJuMPScalar}, var"#s1852"<:AbstractMatrix{var"#s166"}, var"#s166"<:Union{Number, AbstractJuMPScalar}, var"#s1853"<:AbstractMatrix{var"#s166"}, var"#s166"<:Union{Number, AbstractJuMPScalar}}}
Write a CompactCovarianceUncertaintySet fitted on the Investable Mask back onto the full asset universe.
The expansion is the inverse of port_opt_view. The view leaves a zero row of the basis out of R, because a zero row adds nothing to the Gram matrix. So the view at the mask recovers the fitted set. The rows outside the mask also hold a zero of C, so the set states nothing about an asset that the prior could not estimate. The nominal covariance is the full pr.sigma, with its NaN frame. The estimator calibrated the set on this prior, and the prior covers the full universe.
Algorithm
- Allocate a zero frame of
length(imsk)rows andsize(set.Q, 2)columns. Writeset.Qat the rows that the mask keeps. This frame isQ. - Allocate a zero vector of
length(imsk)entries. Writeset.Cat the same rows. This vector isC. - Build a
CompactCovarianceUncertaintySetfrom the two, withkappaandRunchanged andpr.sigmaasval. A zero row adds nothing to the Gram matrix of the basis, soRstays the factor of the rows that a view dropped.
Arguments
set: Compact covariance uncertainty set fitted on the reduced prior.imsk: The Investable Mask of the full prior.pr: Prior result.
Returns
set::CompactCovarianceUncertaintySet: The set on the full asset universe.
Related