markowitz.core.merton_scalars¶
markowitz.core.merton_scalars
¶
Merton's ABCD scalars for the analytic mean-variance frontier.
Given an expected-return vector mu and a covariance matrix Sigma,
the four scalar functionals
A = 1^T Sigma^-1 1
B = 1^T Sigma^-1 mu
C = mu^T Sigma^-1 mu
D = A * C - B**2 (>= 0 by Cauchy-Schwarz)
parameterize every closed-form quantity associated with the unconstrained mean-variance frontier: the global minimum-variance portfolio, the tangency portfolio for an arbitrary risk-free rate, and any efficient-return portfolio. See Merton (1972, JFQA) for a derivation.
The implementation never materializes Sigma^-1; it relies on a
single Cholesky factorization wrapped by :func:cholesky_solve.
MertonABCD
¶
Bases: NamedTuple
The four Merton scalars characterising an analytic frontier.
compute_abcd(mu: npt.ArrayLike, Sigma: npt.ArrayLike) -> MertonABCD
¶
Compute Merton's (A, B, C, D) scalars.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mu
|
ArrayLike
|
Expected-return vector of length |
required |
Sigma
|
ArrayLike
|
Symmetric positive definite covariance matrix of shape |
required |
Returns:
| Name | Type | Description |
|---|---|---|
A |
class:`MertonABCD` named tuple.
|
|
Raises:
| Type | Description |
|---|---|
NumericalError
|
If shapes are inconsistent or |
SingularCovarianceError
|
Propagated from :func: |