Augmented Black-Litterman Prior
PortfolioOptimisers.AugmentedBlackLittermanPrior Type
struct AugmentedBlackLittermanPrior{__T_a_pe, __T_f_pe, __T_mp, __T_re, __T_a_views, __T_f_views, __T_a_sets, __T_f_sets, __T_a_views_conf, __T_f_views_conf, __T_w, __T_rf, __T_l, __T_tau} <: AbstractLowOrderPriorEstimator_FAugmented Black-Litterman prior estimator for asset returns.
AugmentedBlackLittermanPrior is a low order prior estimator that computes the mean and covariance of asset returns using an augmented Black-Litterman model. It combines asset and factor prior estimators, matrix post-processing, regression and variance estimators, asset and factor views, asset and factor sets, view confidences, weights, risk-free rate, leverage, and a blending parameter tau. This estimator supports both direct and constraint-based views, flexible confidence specification, and matrix processing, and incorporates joint asset-factor Bayesian updating for posterior inference.
Mathematical definition
Factor model linking assets and factors via regression:
Augmented prior moments (stacking asset and factor priors):
Black-Litterman posterior on the augmented space with combined views
Where:
: asset returns matrix. : factor returns matrix. : factor loadings (regression coefficients). : regression intercept vector. , : Asset prior mean and covariance. , : Factor prior mean and covariance. , : Augmented (joint asset-factor) prior moments. : Augmented posterior mean (asset component extracted as final result). : Scaling parameter for the prior uncertainty. : Combined asset and factor views matrix. : Combined asset and factor views vector. : Combined view uncertainty matrix.
Asset posterior extracted from the augmented result and adjusted for intercept and risk-free rate.
Fields
a_pe: Asset prior estimator.f_pe: Factor prior estimator.mp: Matrix processing estimator.re: Regression estimator.a_views: Asset views estimator or result.f_views: Factor views estimator or result.a_sets: Asset sets.f_sets: Factor sets.a_views_conf: Asset views confidence estimator or result.f_views_conf: Factor views confidence estimator or result.w: Equilibrium weights vectorfeatures × 1.rf: Risk-free rate.l: Risk aversion parameter.tau: Blending parameter controlling the weight given to the prior relative to the views.
Constructors
AugmentedBlackLittermanPrior(;
a_pe::AbstractLowOrderPriorEstimator_A_AF = EmpiricalPrior(),
f_pe::AbstractLowOrderPriorEstimator_A_AF = EmpiricalPrior(),
mp::AbstractMatrixProcessingEstimator = MatrixProcessing(),
re::AbstractRegressionEstimator = StepwiseRegression(),
a_views::Lc_BLV,
f_views::Lc_BLV,
a_sets::Option{<:AssetSets} = nothing,
f_sets::Option{<:AssetSets} = nothing,
a_views_conf::Option{<:Num_VecNum} = nothing,
f_views_conf::Option{<:Num_VecNum} = nothing,
w::Option{<:VecNum} = nothing,
rf::Number = 0.0,
l::Option{<:Number} = nothing,
tau::Option{<:Number} = nothing
) -> AugmentedBlackLittermanPriorKeywords correspond to the struct's fields.
Validation
If
wis notnothing,!isempty(w).If
a_viewsis aLinearConstraintEstimator,!isnothing(a_sets).If
f_viewsis aLinearConstraintEstimator,!isnothing(f_sets).If
a_views_confis notnothing, validated withassert_bl_views_conf.If
f_views_confis notnothing, validated withassert_bl_views_conf.If
tauis notnothing,tau > 0.
Examples
julia> AugmentedBlackLittermanPrior(;
a_sets = AssetSets(; key = "nx",
dict = Dict("nx" => ["A", "B", "C"])),
f_sets = AssetSets(; key = "nx",
dict = Dict("nx" => ["F1", "F2"])),
a_views = LinearConstraintEstimator(;
val = ["A == 0.03",
"B + C == 0.04"]),
f_views = LinearConstraintEstimator(;
val = ["F1 == 0.01",
"F2 == 0.02"]))
AugmentedBlackLittermanPrior
a_pe ┼ EmpiricalPrior
│ ce ┼ PortfolioOptimisersCovariance
│ │ ce ┼ Covariance
│ │ │ me ┼ SimpleExpectedReturns
│ │ │ │ w ┴ nothing
│ │ │ ce ┼ GeneralCovariance
│ │ │ │ ce ┼ StatsBase.SimpleCovariance: StatsBase.SimpleCovariance(true)
│ │ │ │ w ┴ nothing
│ │ │ alg ┴ Full()
│ │ mp ┼ MatrixProcessing
│ │ │ pdm ┼ Posdef
│ │ │ │ alg ┼ UnionAll: NearestCorrelationMatrix.Newton
│ │ │ │ kwargs ┴ @NamedTuple{}: NamedTuple()
│ │ │ dn ┼ nothing
│ │ │ dt ┼ nothing
│ │ │ alg ┼ nothing
│ │ │ order ┴ NTuple{4, Symbol}: (:pdm, :dn, :dt, :alg)
│ me ┼ SimpleExpectedReturns
│ │ w ┴ nothing
│ horizon ┴ nothing
f_pe ┼ EmpiricalPrior
│ ce ┼ PortfolioOptimisersCovariance
│ │ ce ┼ Covariance
│ │ │ me ┼ SimpleExpectedReturns
│ │ │ │ w ┴ nothing
│ │ │ ce ┼ GeneralCovariance
│ │ │ │ ce ┼ StatsBase.SimpleCovariance: StatsBase.SimpleCovariance(true)
│ │ │ │ w ┴ nothing
│ │ │ alg ┴ Full()
│ │ mp ┼ MatrixProcessing
│ │ │ pdm ┼ Posdef
│ │ │ │ alg ┼ UnionAll: NearestCorrelationMatrix.Newton
│ │ │ │ kwargs ┴ @NamedTuple{}: NamedTuple()
│ │ │ dn ┼ nothing
│ │ │ dt ┼ nothing
│ │ │ alg ┼ nothing
│ │ │ order ┴ NTuple{4, Symbol}: (:pdm, :dn, :dt, :alg)
│ me ┼ SimpleExpectedReturns
│ │ w ┴ nothing
│ horizon ┴ nothing
mp ┼ MatrixProcessing
│ pdm ┼ Posdef
│ │ alg ┼ UnionAll: NearestCorrelationMatrix.Newton
│ │ kwargs ┴ @NamedTuple{}: NamedTuple()
│ dn ┼ nothing
│ dt ┼ nothing
│ alg ┼ nothing
│ order ┴ NTuple{4, Symbol}: (:pdm, :dn, :dt, :alg)
re ┼ StepwiseRegression
│ crit ┼ PValue
│ │ t ┴ Float64: 0.05
│ alg ┼ Forward()
│ tgt ┼ LinearModel
│ │ kwargs ┴ @NamedTuple{}: NamedTuple()
a_views ┼ LinearConstraintEstimator
│ val ┼ Vector{String}: ["A == 0.03", "B + C == 0.04"]
│ key ┴ nothing
f_views ┼ LinearConstraintEstimator
│ val ┼ Vector{String}: ["F1 == 0.01", "F2 == 0.02"]
│ key ┴ nothing
a_sets ┼ AssetSets
│ key ┼ String: "nx"
│ ukey ┼ String: "ux"
│ dict ┴ Dict{String, Vector{String}}: Dict("nx" => ["A", "B", "C"])
f_sets ┼ AssetSets
│ key ┼ String: "nx"
│ ukey ┼ String: "ux"
│ dict ┴ Dict{String, Vector{String}}: Dict("nx" => ["F1", "F2"])
a_views_conf ┼ nothing
f_views_conf ┼ nothing
w ┼ nothing
rf ┼ Float64: 0.0
l ┼ nothing
tau ┴ nothingRelated
sourcePortfolioOptimisers.factory Method
factory(
pe::AugmentedBlackLittermanPrior,
w::Union{DynamicAbstractWeights, AbstractWeights}
) -> AugmentedBlackLittermanPrior{_A, _B, var"#s179", var"#s1791", _C, _D, _E, _F, _G, _H, _I, <:Number} where {_A, _B, var"#s179"<:AbstractMatrixProcessingEstimator, var"#s1791"<:AbstractRegressionEstimator, _C, _D, _E, _F, _G, _H, _I}Return a new AugmentedBlackLittermanPrior estimator with observation weights w applied to the underlying asset prior, factor prior, and regression estimators.
Related
sourceBase.getproperty Method
getproperty(
obj::AugmentedBlackLittermanPrior,
sym::Symbol
) -> AnyAccess properties of AugmentedBlackLittermanPrior. Exposes :me, :ce from the asset prior obj.a_pe and :f_me, :f_ce from the factor prior obj.f_pe for transparent access.
PortfolioOptimisers.prior Method
prior(pe::AugmentedBlackLittermanPrior, X::MatNum, F::MatNum; dims::Int = 1,
strict::Bool = false, kwargs...)Compute augmented Black-Litterman prior moments for asset returns.
prior estimates the mean and covariance of asset returns using the augmented Black-Litterman model, combining asset and factor prior estimators, matrix post-processing, regression and variance estimators, asset and factor views, asset and factor sets, view confidences, weights, risk-free rate, leverage, and a blending parameter tau. This method supports both direct and constraint-based views, flexible confidence specification, and matrix processing, and incorporates joint asset-factor Bayesian updating for posterior inference.
Arguments
pe: Augmented Black-Litterman prior estimator.X: Asset returns matrix (observations × assets).F: Factor matrix (observations × factors).dims: Dimension along which to perform the computation.strict: Iftrue, enforce strict validation of views and sets. Default isfalse.kwargs...: Additional keyword arguments passed to underlying estimators and matrix processing.
Returns
pr::LowOrderPrior: Result object containing asset returns, posterior mean vector, posterior covariance matrix, regression result, and factor prior details.
Validation
dims in (1, 2).length(pe.a_sets.dict[pe.a_sets.key]) == size(X, 2).length(pe.f_sets.dict[pe.f_sets.key]) == size(F, 2).If
pe.wis notnothing,length(pe.w) == size(X, 2).
Details
If
dims == 2,XandFare transposed to ensure assets/factors are in columns.Asset and factor priors are computed using the embedded prior estimators
pe.a_peandpe.f_pe.Factor regression is performed using the regression estimator
pe.re.Asset and factor views are extracted using
black_litterman_views, which returns the view matrices and view returns vectors.taudefaults to1/Tif not specified, whereTis the number of observations.View uncertainty matrices for assets and factors are computed using
calc_omega.The augmented prior mean and covariance are constructed by combining asset and factor priors and regression loadings.
The augmented Black-Litterman posterior mean and covariance are computed using
vanilla_posteriors.Matrix processing is applied to the augmented posterior covariance.
The final asset posterior mean and covariance are extracted from the augmented results and adjusted for regression intercepts and risk-free rate.
The result includes asset returns, posterior mean, posterior covariance, regression result, and factor prior details.
Related
sourcePortfolioOptimisers.port_opt_view Method
port_opt_view(
pe::AugmentedBlackLittermanPrior,
i,
args...
) -> AugmentedBlackLittermanPrior{_A, _B, var"#s179", var"#s1791", _C, _D, _E, _F, _G, _H, _I, <:Number} where {_A, _B, var"#s179"<:AbstractMatrixProcessingEstimator, var"#s1791"<:AbstractRegressionEstimator, _C, _D, _E, _F, _G, _H, _I}Return a new AugmentedBlackLittermanPrior estimator restricted to the assets at index i.
Related
source