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

  1. Allocate a zero frame of length(imsk) rows and size(set.Q, 2) columns. Write set.Q at the rows that the mask keeps. This frame is Q.
  2. Allocate a zero vector of length(imsk) entries. Write set.C at the same rows. This vector is C.
  3. Build a CompactCovarianceUncertaintySet from the two, with kappa and R unchanged and pr.sigma as val. A zero row adds nothing to the Gram matrix of the basis, so R stays 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

source