markowitz.views.equilibrium¶
markowitz.views.equilibrium
¶
Reverse-optimisation utilities producing equilibrium-implied excess returns.
The Black-Litterman model anchors its prior on the implied equilibrium
return vector pi = delta * Sigma * w_mkt, where w_mkt is the vector of
market-capitalisation weights and delta is the representative investor's
risk-aversion coefficient. These two helpers are intentionally lightweight so
that they can be reused outside of the BL pipeline (for instance, by a
diagnostic dashboard).
implied_returns(cov: pd.DataFrame, market_weights: pd.Series, delta: float = 2.5) -> pd.Series
¶
Compute the equilibrium-implied excess-return vector.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cov
|
DataFrame
|
Asset return covariance matrix as a square |
required |
market_weights
|
Series
|
Market-capitalisation weights indexed by asset. The index must align
with |
required |
delta
|
float
|
Representative-investor risk-aversion coefficient. Defaults to the
commonly cited value of |
2.5
|
Returns:
| Type | Description |
|---|---|
Series
|
Implied excess returns |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the covariance matrix is not square, weights cannot be aligned, or
|
Source code in src/markowitz/views/equilibrium.py
infer_delta(market_returns: pd.Series, risk_free_rate: float, ddof: int = 1) -> float
¶
Estimate the risk-aversion coefficient from market-return history.
Uses the standard identity delta = (E[r_m] - rf) / Var[r_m] where
r_m is the market portfolio return series. The series is assumed to
already be on the same periodicity as risk_free_rate (e.g. both annual
or both daily).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
market_returns
|
Series
|
Realised market returns (not excess). |
required |
risk_free_rate
|
float
|
Periodic risk-free rate matching the periodicity of
|
required |
ddof
|
int
|
Degrees-of-freedom passed through to :meth: |
1
|
Returns:
| Type | Description |
|---|---|
float
|
The implied risk-aversion coefficient. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the input series has fewer than two observations or has zero variance. |