Bayesian Black-Litterman Prior: private API
PortfolioOptimisers.show_fields — Method
show_fields(
_::BayesianBlackLittermanPrior
) -> NTuple{9, Symbol}
Give every field of a BayesianBlackLittermanPrior to print, except cache.
The state in cache changes at each step of an incremental fit, and it is not part of the configuration. Each site that prints the estimator also prints this state, unless this method leaves it out. Set set_show_nothing_fields!(:BayesianBlackLittermanPrior, true) to print it.
Arguments
::BayesianBlackLittermanPrior: Prior estimator, read for its type alone.
Returns
fields::Tuple: The field names to render, which is(:pe, :f_mp, :mp, :views, :sets, :views_conf, :rf, :tau, :x_src).
Related
PortfolioOptimisers.assert_bbl_views_axis — Function
assert_bbl_views_axis(
pe::BayesianBlackLittermanPrior,
F::AbstractMatrix{<:Union{Number, AbstractJuMPScalar}}
)
Refuses a BayesianBlackLittermanPrior whose factor universe does not describe the factor returns.
The fit and the refit of scenario_prior both run this check before they fit the wrapped prior.
Arguments
pe: Bayesian Black-Litterman prior estimator.F: Factor returns,observations × factors.
Validation
- If
pe.viewsis aLinearConstraintEstimator,haskey(pe.sets.dict, pe.sets.tfkey)andlength(pe.sets.dict[pe.sets.tfkey]) == size(F, 2), both throughfactor_universe.
Returns
nothing.
Related
PortfolioOptimisers.bbl_posterior — Function
bbl_posterior(
pe::BayesianBlackLittermanPrior,
prior_result::AbstractPriorResult,
F::AbstractMatrix{<:Union{Number, AbstractJuMPScalar}},
strict::Bool;
kwargs...
) -> Union{HighOrderPrior, LowOrderPrior}
Blends the factor views of a BayesianBlackLittermanPrior into the result of its wrapped prior.
This function holds all the work of the estimator after the fit of the wrapped prior. That work is the rest of step 3 and steps 4 to 16 of the returns-matrix method of prior. The batch fit calls it with the result of a fit over the matrices of the caller. The refit of scenario_prior calls it with the result of a refit of the wrapped prior under new scenario weights. The function does not read the asset returns, because the result carries them. It reads the factor returns for the observation count of the views and for the processing of the factor covariance.
Arguments
pe: Bayesian Black-Litterman prior estimator.prior_result: The result of the wrapped priorpe.pe.F: Factor returns,observations × factors.strict: Iftrue, enforce strict validation of views and sets.kwargs...: More keyword arguments, for matrix processing.
Validation
- The rules of the returns-matrix method of
prior, from step 3 on.
Returns
pr::LowOrderPrior: The result that the returns-matrix method ofpriorstates.
Related