Factor risk contribution: private API

PortfolioOptimisers.factor_risk_contribution_td_defaultsFunction
factor_risk_contribution_td_defaults(

) -> @NamedTuple{re::StepwiseRegression{PValue{Float64}, ForwardSelection, LinearModel{@NamedTuple{}}}, r::Variance{RiskMeasureSettings{Float64, Nothing, Bool}, Nothing, Nothing, Nothing, SquaredSOCRiskExpr}, obj::MinimumRisk}

Return the static defaults of the FactorRiskContribution fields that may hold a TimeDependent.

Shared by the constructor's test-substitution pass and time_dependent_field_defaults, so the fold-less value of a field is declared once. Fields whose static default is nothing are omitted.

Related

source
PortfolioOptimisers.set_factor_risk_contribution_constraints!Method
set_factor_risk_contribution_constraints!(model, re, rd, pr, flag, wi)

Add factor risk contribution constraints to the JuMP model.

Re-bases the weight variable onto the factor axis, w = b1 * w1 (or w = b1 * w1 + b2 * w2 when flag is true), using the factor loadings to specify the basis.

The loadings come from resolve_factor_regression, which is the same precedence the value-level factor_risk_contribution uses: a precomputed Regression in re wins, then the prior's own rr, then a refit from rd. The prior outranks the refit so that the decision basis is the one the moments were projected through.

Warning

A stated regression estimator loses to a prior that carries loadings. To override a factor prior, pass the loadings as a precomputed Regression in re.

Arguments

  • model: JuMP model.
  • re: Regression result or estimator (RegE_Reg).
  • rd: Returns result carrying X and F, used only when the loadings must be refitted.
  • pr: Prior result, read for its factor block.
  • flag: Whether to add the off-factor weight block.
  • wi: Optional initial factor weights.

Returns

  • b1, rr: The factor basis and the loadings it was built from.

Related

source