Compact Radius Rules: private API
PortfolioOptimisers.compact_reference_weights — Function
compact_reference_weights(::Nothing, N::Integer, ::Any, ::Type{E}) where {E}
compact_reference_weights(w0::VecNum, N::Integer, ::Any, ::Type)
compact_reference_weights(w0::NonFiniteAllocationOptimisationEstimator, N::Integer,
rd, ::Type)Reference portfolio at which a VarianceFraction sizes its penalty.
Algorithm
- On
nothing, return the equal-weight portfolio over theNassets of the span, in the element typeE. - On a vector, check that it has one entry per asset and return it.
- On an optimiser, run
optimiseonrd, check that the weights have one entry per asset, and return them. The optimiser carries its own solver, so the fit of the set passes it nothing.
Arguments
w0: Thew0field of the rule.N: Number of assets of the span.rd: Returns data of the fit, ornothing.E: Element type of the geometry.
Validation
- A stated vector has
Nentries, else aDimensionMismatch. - An optimiser meets a
ReturnsResult, else anIsNothingError. A set fitted from a prior result alone has no returns data for the optimiser to run on. - The optimiser's weights have
Nentries, else aDimensionMismatch.
Returns
w0::VecNum: Reference portfolio of lengthN. A stated vector comes back unchanged.
Related