Skip to content
13

Augmented Black-Litterman Prior

PortfolioOptimisers.AugmentedBlackLittermanPrior Type
julia
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_F

Augmented 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:

XFM+1b.

Augmented prior moments (stacking asset and factor priors):

μaug=(μaμf),Σaug=(ΣaΣaMMΣaΣf).

Black-Litterman posterior on the augmented space with combined views (Paug,qaug):

μpost=μaug+τΣaugPaug(τPaugΣaugPaug+Ωaug)1(qaugPaugμaug).

Where:

  • X: T×N asset returns matrix.

  • F: T×K factor returns matrix.

  • M: K×N factor loadings (regression coefficients).

  • b: N×1 regression intercept vector.

  • μa, Σa: Asset prior mean and covariance.

  • μf, Σf: Factor prior mean and covariance.

  • μaug, Σaug: Augmented (joint asset-factor) prior moments.

  • μpost: Augmented posterior mean (asset component extracted as final result).

  • τ: Scaling parameter for the prior uncertainty.

  • Paug: Combined asset and factor views matrix.

  • qaug: Combined asset and factor views vector.

  • Ωaug: 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 vector features × 1.

  • rf: Risk-free rate.

  • l: Risk aversion parameter.

  • tau: Blending parameter controlling the weight given to the prior relative to the views.

Constructors

julia
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
) -> AugmentedBlackLittermanPrior

Keywords correspond to the struct's fields.

Validation

Examples

julia
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 ┴ nothing

Related

source
PortfolioOptimisers.factory Method
julia
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

source
Base.getproperty Method
julia
getproperty(
    obj::AugmentedBlackLittermanPrior,
    sym::Symbol
) -> Any

Access 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.

source
PortfolioOptimisers.prior Method
julia
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: If true, enforce strict validation of views and sets. Default is false.

  • 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.w is not nothing, length(pe.w) == size(X, 2).

Details

  • If dims == 2, X and F are transposed to ensure assets/factors are in columns.

  • Asset and factor priors are computed using the embedded prior estimators pe.a_pe and pe.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.

  • tau defaults to 1/T if not specified, where T is 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

source
PortfolioOptimisers.port_opt_view Method
julia
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