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_sets, __T_a_views_conf, __T_f_views_conf, __T_w, __T_rf, __T_l, __T_tau, __T_cache, __T_x_src} <: AbstractLowOrderPriorEstimator_F

Augmented Black-Litterman prior estimator for asset returns.

AugmentedBlackLittermanPrior is a low order prior estimator. It stacks an asset prior and a factor prior into one joint prior. It applies asset views and factor views to the joint prior with the Black-Litterman master equations. The result is the asset half and the factor half of the posterior.

Mathematical definition

The regression of the assets on the factors gives the factor model:

\[\begin{align} \mathbf{X} &\approx \mathbf{F}\mathbf{M}^{\intercal} + \mathbf{1}\boldsymbol{b}^{\intercal}\,. \end{align}\]

The augmented prior moments stack the asset prior and the factor prior:

\[\begin{align} \boldsymbol{\mu}_{aug} &= \begin{pmatrix}\boldsymbol{\mu}_a \\ \boldsymbol{\mu}_f\end{pmatrix} \quad\text{or}\quad \lambda\begin{pmatrix}\boldsymbol{\Sigma}_a \\ \boldsymbol{\Sigma}_f\mathbf{M}^{\intercal}\end{pmatrix}\boldsymbol{w} + \begin{pmatrix}\boldsymbol{b} \\ \mathbf{0}\end{pmatrix} + r_{f}\,, \\ \boldsymbol{\Sigma}_{aug} &= \begin{pmatrix}\boldsymbol{\Sigma}_a & \mathbf{M}\boldsymbol{\Sigma}_f \\ \boldsymbol{\Sigma}_f\mathbf{M}^{\intercal} & \boldsymbol{\Sigma}_f\end{pmatrix}\,. \end{align}\]

The left prior mean stacks the two wrapped means, and the estimator uses it when pe.l === nothing. The right prior mean is the equilibrium mean that pe.l selects. It adds two levels that the wrapped means contain already: the intercept $\boldsymbol{b}$ on the asset half, and the risk-free rate. Both levels must be in $\boldsymbol{\mu}_{aug}$ before the update, because the update blends this mean against $\boldsymbol{q}_{aug}$ through the residual $\boldsymbol{q}_{aug} - \mathbf{P}_{aug}\boldsymbol{\mu}_{aug}$.

The off-diagonal blocks are the cross-covariance of the factor model, $\mathrm{cov}(\mathbf{X}, \mathbf{F}) = \mathbf{M}\boldsymbol{\Sigma}_f$. The estimator builds them from the factor covariance, not from the asset covariance. So they hold only factor variance, but the first diagonal block holds factor and residual variance. This difference opens the gap of the second warning below.

The estimator stacks the views block-diagonally, each set over its own axis:

\[\begin{align} \mathbf{P}_{aug} &= \begin{pmatrix}\mathbf{P} & \mathbf{0} \\ \mathbf{0} & \mathbf{P}_f\end{pmatrix}\,, \quad \boldsymbol{q}_{aug} = \begin{pmatrix}\boldsymbol{q} \\ \boldsymbol{q}_f\end{pmatrix}\,, \quad \boldsymbol{\Omega}_{aug} = \begin{pmatrix}\boldsymbol{\Omega} & \mathbf{0} \\ \mathbf{0} & \boldsymbol{\Omega}_f\end{pmatrix}\,. \end{align}\]

The master equations give the Black-Litterman posterior on the augmented space:

\[\begin{align} \boldsymbol{\mu}_{post} &= \boldsymbol{\mu}_{aug} + \tau\boldsymbol{\Sigma}_{aug}\mathbf{P}_{aug}^{\intercal}\left(\tau\mathbf{P}_{aug}\boldsymbol{\Sigma}_{aug}\mathbf{P}_{aug}^{\intercal} + \boldsymbol{\Omega}_{aug}\right)^{-1}\!\left(\boldsymbol{q}_{aug} - \mathbf{P}_{aug}\boldsymbol{\mu}_{aug}\right)\,, \\ \boldsymbol{\Sigma}_{post} &= \boldsymbol{\Sigma}_{aug} + \tau\boldsymbol{\Sigma}_{aug} - \tau\boldsymbol{\Sigma}_{aug}\mathbf{P}_{aug}^{\intercal}\left(\tau\mathbf{P}_{aug}\boldsymbol{\Sigma}_{aug}\mathbf{P}_{aug}^{\intercal} + \boldsymbol{\Omega}_{aug}\right)^{-1}\!\mathbf{P}_{aug}\tau\boldsymbol{\Sigma}_{aug}\,. \end{align}\]

Truncation then gives the two halves, with no other change. The intercept and the risk-free rate are already in $\boldsymbol{\mu}_{aug}$ above, where the update blends the views against them:

\[\begin{align} \hat{\boldsymbol{\mu}} &= \left(\boldsymbol{\mu}_{post}\right)_{1:N}\,, \quad \hat{\mathbf{\Sigma}} = \left(\boldsymbol{\Sigma}_{post}\right)_{1:N,\,1:N}\,, \\ \hat{\boldsymbol{\mu}}_f &= \left(\boldsymbol{\mu}_{post}\right)_{N+1:N+K}\,, \quad \hat{\mathbf{\Sigma}}_f = \left(\boldsymbol{\Sigma}_{post}\right)_{N+1:N+K,\,N+1:N+K}\,. \end{align}\]

Where:

  • $T$, $N$, $K$: The number of observations, of assets, and of factors.
  • $\mathbf{X}$: $T \times N$ asset returns matrix.
  • $\mathbf{F}$: $T \times K$ factor returns matrix.
  • $\mathbf{M}$: $N \times K$ factor loadings, the regression coefficients, pr.rr.M.
  • $\boldsymbol{b}$: $N \times 1$ regression intercept vector, pr.rr.b.
  • $\boldsymbol{\mu}_a$, $\boldsymbol{\Sigma}_a$: $N \times 1$ and $N \times N$ asset prior mean and covariance, from a_pe.
  • $\boldsymbol{\mu}_f$, $\boldsymbol{\Sigma}_f$: $K \times 1$ and $K \times K$ factor prior mean and covariance, from f_pe.
  • $\boldsymbol{\mu}_{aug}$, $\boldsymbol{\Sigma}_{aug}$: Augmented prior moments over the joint axis of assets and factors, of length and order $N + K$.
  • $\boldsymbol{\mu}_{post}$, $\boldsymbol{\Sigma}_{post}$: Augmented posterior moments, of the same shape.
  • $\tau$: Scaling parameter for the prior uncertainty, 1/T by default.
  • $\mathbf{P}$, $\boldsymbol{q}$, $\boldsymbol{\Omega}$: Asset views matrix, returns vector and uncertainty matrix, over the asset axis.
  • $\mathbf{P}_f$, $\boldsymbol{q}_f$, $\boldsymbol{\Omega}_f$: The same three over the factor axis.
  • $\mathbf{P}_{aug}$, $\boldsymbol{q}_{aug}$, $\boldsymbol{\Omega}_{aug}$: The same three stacked over the augmented axis, the asset rows above the factor rows.
  • $\hat{\boldsymbol{\mu}}$, $\hat{\mathbf{\Sigma}}$: $N \times 1$ and $N \times N$ posterior asset moments, pr.mu and pr.sigma.
  • $\hat{\boldsymbol{\mu}}_f$, $\hat{\mathbf{\Sigma}}_f$: $K \times 1$ and $K \times K$ posterior factor moments, pr.fpr.mu and pr.fpr.sigma.
  • $\lambda$, $\boldsymbol{w}$: The risk-aversion coefficient pe.l and the equilibrium weights pe.w. equilibrium_mu reads them, and only when pe.l is set.
  • $r_{f}$: Risk-free rate. apply_rf adds it once, to the equilibrium mean. It is absent when pe.l is nothing, because the wrapped means are total returns already.

The stacked inputs and the master equations follow Cajas [12], who follows Cheung [156]. Cajas [12] builds the equilibrium mean as $\delta\,(\boldsymbol{\Sigma};\ \boldsymbol{\Sigma}_f\mathbf{M}^{\intercal})\,\boldsymbol{w}$ with no intercept, and adds $r_f$ to the posterior. The library adds the intercept and $r_f$ to the equilibrium mean before the update, as the text above states. Cajas [12] does not state the diagonal blocks of $\boldsymbol{\Omega}_{aug}$. The library sets each block to $\tau\,\mathrm{Diag}(\mathbf{P}\mathbf{\Sigma}\mathbf{P}^\intercal)$ over the covariance of its own axis.

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.
  • sets: Universe sets. This estimator reads two declared axes. a_views resolves against sets.dict[sets.xkey], which must name the columns of X in order. f_views resolves against the time-series factor axis sets.dict[sets.tfkey], which must name the columns of F in order. A LinearConstraintEstimator needs only the axis that it resolves names against. Views in a BlackLittermanViews result carry their own matrix and need no universe. A view slices the asset axis and keeps the factor entries, so this field is @vprop.
  • a_views_conf: Asset views confidence estimator or result.
  • f_views_conf: Factor views confidence estimator or result.
  • w: Optional equilibrium weights vector assets × 1. If nothing, equilibrium_mu uses equal weights.
  • rf: Risk-free rate. The Black-Litterman update compares the prior mean with the view returns, so it uses the total-return scale of the views. A mean from a wrapped prior estimator has that scale. An equilibrium mean is only a risk premium, and the rate converts it before the update. A member with no equilibrium branch has no mean to convert, and it adds the rate to the posterior asset expected returns. In both cases the estimator adds the rate once. It does not change the wrapped prior estimators, so a risk-free rate that one of them applied stays in its mean.
  • l: Risk aversion parameter.
  • tau: The scale of the uncertainty of the prior mean, tau > 0. If nothing, the estimator uses 1/T, where T is the number of observations.
  • cache: Optional partial-fit state. It is nothing until partial_fit! writes one. When the caller gives no data matrix, the batch verb of the estimator reads it. Each propagation channel does one thing with it. factory keeps it unchanged, because a factory call resolves the configuration, not the sample. port_opt_view copies the entries of the selected assets into a new state, so the viewed estimator holds the state of those assets alone. obs_weights_view removes it, because a state has no slice on the observation axis. Only a type with an observation-weights field has that channel. A type with no such field falls through to the identity method, so it keeps its state. A family whose state has no exact asset slice removes it on both axes and names the reason.
  • x_src: The source of the returns that the prior fits on, nothing or an AbstractReturnsSource. nothing and DataSource read the asset returns rd.X. ExcessSource reads the returns in excess of the benchmark, rd.X - rd.B, the Excess Frame, and refuses returns data with no benchmark. nothing means that the caller stated no source, so an optimiser that holds a reader of the Excess Frame warns about a prior at nothing, and not about a prior at DataSource(). A prior reads no prior, so it refuses PriorSource. A prior inside another estimator, such as the pe of a FactorPrior, keeps nothing, and the outer estimator states the source.

Constructors

AugmentedBlackLittermanPrior(;    a_pe::AbstractLowOrderPriorEstimator_A_AF = EmpiricalPrior(),    f_pe::AbstractLowOrderPriorEstimator_A_AF = EmpiricalPrior(),    mp::AbstractMatrixProcessingEstimator = MatrixProcessing(),    re::AbstractTimeSeriesRegressionEstimator = StepwiseRegression(),    a_views::Lc_BLV,    f_views::Lc_BLV,    sets::Option{<:UniverseSets} = 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,    cache::Option{<:AbstractPartialFitState} = nothing,    x_src::Option{<:AbstractReturnsSource} = nothing) -> AugmentedBlackLittermanPrior

Keywords correspond to the struct's fields.

Composition: what this estimator forwards

This estimator merges two priors and builds its prior result directly. It does not forward one prior along its own axis. A posterior field still replaces the prior field of the same name, and a structural field still forwards whole. The estimator solves one augmented Black-Litterman system over [assets; factors], and it gives both halves:

  • mu and sigma are the asset half of the augmented posterior. The factor block fpr is the factor half, so both blocks are posterior. The estimator drops chol on both blocks, because the posterior covariances replace the covariances that chol factorises.
  • w, ens, kld and ow come from the asset prior. The same fields of fpr come from the factor prior. Two priors with different observation weights are a valid configuration, and the nested block keeps the two weightings apart.
  • pc, the cache of an opinion pool, comes from the asset prior only. The cache of the factor prior holds factor returns, and it does not describe the asset axis.
Warning

The returned mu and sigma are the augmented posterior, but w is the observation weighting of the asset prior, forwarded with no change. fpr.w is the weighting of the factor prior. Black-Litterman gives no posterior over the observations, so no weighting that agrees with the posterior exists. If the estimator drops w, the unweighted empirical distribution takes its place, and that is further from the weights that the caller computed. So pr.w, pr.ens, pr.kld and pr.ow describe the asset prior, not the posterior. With an entropy pooling prior on each axis, these four fields equal those of the asset prior. pr.fpr.w equals the weighting of the factor prior, and it differs from pr.w.

Warning

pr.mu != pr.rr.M * pr.fpr.mu + pr.rr.b, but both blocks are posterior. The update opens the gap in two ways.

Idiosyncratic variance, on every branch. The augmented covariance stacks the full asset covariance sigma_a against the cross-covariance M * sigma_f. sigma_a holds factor and residual variance, but M * sigma_f holds factor variance alone. So the update moves the asset half by tau * sigma_a * P'(…) and the factor half by tau * sigma_f * M' * P'(…). The two halves stay related by M only if sigma_a == M * sigma_f * M', and that holds only on an exact factor model. This part grows with the residual variance, and both view sets add to it.

The intercept is not a third cause. On an exact factor model with a non-zero intercept, the gap is 1.8e-15. But with a residual, the intercept changes the size of the first part. On a 250 × 5 sample over three factors, the gap is 7.1e-5. When the intercept is removed from X, with no other change, the gap is 1.2e-4.

A non-zero rf, on the l branch alone. apply_rf adds the rate to the whole equilibrium stack, so the asset half gets rf and the factor half gets rf too. The identity carries the factor half through the loadings, and this turns that rf into rf * s for the row sums s of M. On an exact factor model, the gap is rf * (1 - s), to 1.5e-14 at rf = 0.03. With a residual, the rate also goes through the first part, and the gap is not rf * (1 - s). On the same sample at rf = 0.03, the part of the gap that the rate adds differs from rf * (1 - s) by up to 5.9e-4. This part is zero at the default rf = 0.0. When pe.l is nothing, no step reads the field.

Before the update, the two priors satisfy the identity only when both means are the plain sample mean. Least squares with an intercept sets the unweighted residual mean to zero. One shared non-uniform weighting is not enough, because the weighted residual mean is not zero. Two different weightings make the gap larger. On an exact factor model, a shared non-uniform weighting satisfies the identity, because no residual exists.

FactorBlackLittermanPrior and BayesianBlackLittermanPrior satisfy the identity exactly. They update the factor distribution alone, and they project it onto the assets. They do not update an asset block next to it. BlackLittermanPrior takes asset views only, and it computes no posterior factor distribution. When it wraps a prior with no factor block, pr.fpr is nothing, and the right side of the identity does not exist. When it wraps a FactorPrior, pr.fpr is the prior factor block, and the gap on the same sample is 1.7e-3.

One sets, two axes

This is the only estimator with views on both distributions. It needs two axes, and UniverseSets declares both. a_views resolves against sets.dict[sets.xkey], and f_views resolves against sets.dict[sets.tfkey]. The field is @vprop. port_opt_view slices the asset entries, and the factor entries come back with no change. The data, and not a hand-written exemption, keeps the factor universe whole.

The views that resolve names against an axis are the only views that need that axis. A BlackLittermanViews result carries its own P and needs no universe. With one sets, a mandate can have asset views only or factor views only. A pair of precomputed view sets needs no sets, and it gives the same result as the same pair with sets. port_opt_view over a selection of assets keeps the factor axis of sets whole, and it cuts the asset axis and w to the selection.

Validation

The constructor does not check the length of w. The length is a property of the returns matrix, and the constructor does not see that matrix. A wrong length raises a DimensionMismatch from equilibrium_mu in prior, and only when l is set.

Propagated parameters

factory passes its arguments on to these @fprop fields:

  • a_pe: Recursively updated through factory.
  • f_pe: Recursively updated through factory.
  • re: Recursively updated through factory.
  • cache: Carried unchanged through factory.

View parameters

port_opt_view takes the view of these @vprop fields at the selected indices:

Examples

julia> AugmentedBlackLittermanPrior(;                                    sets = UniverseSets(;                                                        dict = Dict("nx" => ["A", "B", "C"],                                                                    "nf" => ["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 ┼ FullMoment()               │              │      │     w ┴ 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)               │           me ┼ SimpleExpectedReturns               │              │   w ┴ nothing               │      horizon ┼ nothing               │   fill_limit ┼ nothing               │        x_src ┴ nothing          f_pe ┼ EmpiricalPrior               │           ce ┼ PortfolioOptimisersCovariance               │              │   ce ┼ Covariance               │              │      │    me ┼ SimpleExpectedReturns               │              │      │       │   w ┴ nothing               │              │      │    ce ┼ GeneralCovariance               │              │      │       │   ce ┼ StatsBase.SimpleCovariance: StatsBase.SimpleCovariance(true)               │              │      │       │    w ┴ nothing               │              │      │   alg ┼ FullMoment()               │              │      │     w ┴ 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)               │           me ┼ SimpleExpectedReturns               │              │   w ┴ nothing               │      horizon ┼ nothing               │   fill_limit ┼ nothing               │        x_src ┴ 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 ┼ ForwardSelection()               │        tgt ┼ LinearModel               │            │   kwargs ┴ @NamedTuple{}: NamedTuple()               │     choice ┼ BatchChoice()               │   included ┼ nothing               │      x_src ┴ nothing       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          sets ┼ UniverseSets               │     xkey ┼ String: "nx"               │    uxkey ┼ String: "ux"               │    tfkey ┼ String: "nf"               │   utfkey ┼ String: "uf"               │    cfkey ┼ String: "ncf"               │   ucfkey ┼ String: "ucf"               │    nikey ┼ String: "ni"               │     dict ┴ Dict{String, Vector{String}}: Dict("nf" => ["F1", "F2"], "nx" => ["A", "B", "C"])  a_views_conf ┼ nothing  f_views_conf ┼ nothing             w ┼ nothing            rf ┼ Float64: 0.0             l ┼ nothing           tau ┼ nothing         x_src ┴ nothing

The incremental fit

This prior has no exact incremental recursion, and it takes the online step by a refit from a sample buffer. Online seeds cache, and partial_fit! adds each observation to it with no change. The prior method with one argument then runs the batch verb of this estimator over the rows that the buffer kept. The result is the batch fit over those rows, and a max_history on the wrapper sets the window of the whole fit.

cache goes through the three propagation channels as every partial-fit state does. factory carries it with no change, and port_opt_view cuts it to the selected assets. obs_weights_view drops it, because a state has no cut on the observation axis. The show method does not print cache, because a buffer that changes at each step is not part of the configuration.

Related

References

  • [156] W. Cheung. The augmented Black-Litterman model: a ranking-free approach to factor-based portfolio construction and beyond. Quantitative Finance 13, 301–316 (2013).
  • [12] D. Cajas. Advanced Portfolio Optimization: A Cutting-edge Quantitative Approach (Springer Nature Switzerland, 2025). Section 5.2, Equations 5.17 to 5.19. The original source of this formulation was not found. The formulation follows this work and is not checked against the original.
source
PortfolioOptimisers.prior — Function
prior(pe::AugmentedBlackLittermanPrior, X::MatNum, F::MatNum,
      pnl::Option{<:AssetPanel} = nothing; dims::Int = 1,
      strict::Bool = false, cache_reg::Bool = false, kwargs...)

Compute augmented Black-Litterman prior moments for asset returns.

prior fits the asset prior and the factor prior, and it stacks them into one joint prior. It applies the asset views and the factor views to the joint prior with the Black-Litterman master equations.

When pe.tau is nothing, the blending parameter is 1/T, where T is the smaller of the effective numbers of observations of the two prior means, from moment_observation_count. It is the number of observations of the oriented X when neither prior states a count. The update gets a total return as its mean, and both halves have that scale. pe.rf reaches the update only when pe.l is set. There it converts the equilibrium risk premium, and it goes on the whole stack. Let $\mathbf{G}$ be the augmented update gain, and let $\mathbf{1}$ be the vector of ones. Against the same estimator at rf = 0, the result moves by rf * (I - G P_aug) * 1 on each half. When pe.l is nothing, no step reads the field, and two fits that differ only in rf are equal on both halves.

Arguments

  • pe: Augmented Black-Litterman prior estimator.
  • X: Asset returns matrix (observations × assets).
  • F: Factor matrix (observations × factors).
  • pnl: Optional AssetPanel, the panel that the returns data held. A wrapping prior forwards it unchanged, so that it can compose an estimator that is fitted on a panel. An estimator that reads no panel ignores it. It reaches pe.a_pe, the prior over the assets. It does not reach pe.f_pe, because the estimator fits pe.f_pe on the factors and no panel describes the factor axis.
  • dims: Dimension along which the computation runs.
  • strict: If true, enforce strict validation of views and sets. Default is false.
  • cache_reg: If true, a prior stores on its result the cache that its refit under new scenario weights reads: a CrossSectionalFactorPrior the active mask and the Return Forecast history on its block, and an OpinionPoolingPrior the rows of pe1, its pooled weights and the cache of pe2 in pc. The refit of an entropy pooling prior around it then runs no regression and no opinion. Every other prior forwards it to the prior that it wraps. Default is false. It reaches pe.a_pe and pe.f_pe.
  • kwargs...: More keyword arguments, for pe.a_pe. They describe the asset axis, for example an active mask or implied volatilities, so they do not reach pe.f_pe.

Validation

pe.w has no named check. When pe.l is set, a pe.w with a length other than size(X, 2) raises a bare DimensionMismatch from the product in equilibrium_mu. When pe.l is nothing, no step reads pe.w.

Returns

  • pr::LowOrderPrior: Result object with the reconstructed asset returns, and with the asset half of the augmented posterior as mu and sigma. It carries the observation weighting of the asset prior, its diagnostics, the cache of its opinion pool, and the regression result. Its factor block fpr holds the factor half of the same posterior. chol is nothing on both blocks.

Algorithm

  1. Orient X and F with dims_oriented, to observations × assets and observations × factors.
  2. When pe.a_views resolves names, check that the declared asset axis has the same length as the width of X.
  3. When pe.f_views resolves names, check the declared factor axis against the width of F with factor_universe. Only the views that resolve names against an axis check that axis, and a pair of precomputed BlackLittermanViews needs no sets.
  4. Fit pe.a_pe on X. The result is a_prior.
  5. Find the Investable Mask and the reduced universe of the asset views with investable_views. Refuse a precomputed asset view matrix over a universe with gaps, with assert_bl_precomputed_universe. View a_prior at the mask with investable_prior. From this step on, N is the reduced count of assets.
  6. Fit pe.f_pe on F, with strict and cache_reg alone. The result is f_prior.
  7. Reduce X at the mask with reduce_columns. Regress it on F with factor_reconstruction, under pe.re viewed to the same mask with coverage_regression. The results are rr and the reconstructed returns posterior_X, both on the reduced asset axis.
  8. Make the asset views with bl_preroll at the default :xkey, over the reduced asset prior covariance. Make the factor views at :tfkey, over the factor prior covariance. Either half can lose all its rows. bl_view_block then gives that half no row, and the stack stays, because the other half still conditions the joint posterior. A departure can empty only the asset half, because a factor axis holds no asset name. When both halves are empty, no view is left, and step 12 takes the joint prior.
  9. Build $\boldsymbol{\Sigma}_{aug}$. Its off-diagonal blocks are the cross-covariance $\mathbf{M}\boldsymbol{\Sigma}_f$ of the factor model and its transpose.
  10. Stack $\mathbf{P}_{aug}$ block-diagonally, and stack $\boldsymbol{q}_{aug}$ and $\boldsymbol{\Omega}_{aug}$ to match. The asset rows are above the factor rows.
  11. Put the stacked prior mean on the total-return scale of the views. The result is aug_prior_mu. When pe.l is nothing, it stacks the wrapped means, which are on that scale already. When pe.l is set, it is the equilibrium mean of equilibrium_mu, plus pe.rf from apply_rf, plus rr.b on the asset half. The equilibrium mean is a risk premium, and it reads pe.w sliced to the reduced axis by investable_weights_view.
  12. Run the master equations with vanilla_posteriors over the augmented space. The result is the augmented posterior pair. When neither half has a view row left, vanilla_posteriors gives back the joint prior. The master equations with an empty $\mathbf{P}_{aug}$ add $\tau\boldsymbol{\Sigma}_{aug}$, and that makes the joint covariance wider with no view to cause it.
  13. Process the augmented posterior covariance in place with sample_matrix_processing!, under pe.mp, hcat(posterior_X, F) and the smaller of the counts of the two prior covariances.
  14. Truncate the asset half from 1:N. Add nothing to it. The intercept and the rate went into the prior mean at step 11, and the update is affine in that mean.
  15. Let n be the smaller of the row counts of a_prior.X and f_prior.X. A Scenario Cap in one nested prior keeps only the last rows of its own returns. The two blocks of the result must describe the same observations, so the result keeps the last n rows. Cut the nested prior with more rows with scenario_tail. It refuses to cut a prior that carries weights, and it gives the count of the moments in eoc. With no cap, n is the count of all observations, and the step cuts nothing. The fit of the moments used every observation, so the cut changes no moment.
  16. Truncate the factor half from N+1:N+K. Forward the factor block with forward_prior, and drop chol. The factor half gets no intercept, because the intercept belongs to the regression and to the asset axis alone. It gets no rate, because the stack had the rate before the update. It gets no second processing pass, because it is a principal submatrix of the matrix that step 13 processed. Do not expand the block, because the reduction did not change the factor axis.
  17. Announce the departures once with announce_bl_departures.
  18. Build the prior result directly. It takes w, its diagnostics and pc from a_prior. It takes the last n rows of the reconstruction as X and of the oriented X as o_X, both cut by scenario_window. It writes each block on the asset axis back onto the full universe. expand_moment writes the moment pair, expand_columns writes the reconstruction, and expand_regression writes the regression.

Related

source

References

[12]
D. Cajas. Advanced Portfolio Optimization: A Cutting-edge Quantitative Approach (Springer Nature Switzerland, 2025).
[156]
W. Cheung. The augmented Black-Litterman model: a ranking-free approach to factor-based portfolio construction and beyond. Quantitative Finance 13, 301–316 (2013).