Shrunk expected returns

PortfolioOptimisers.AbstractShrunkExpectedReturnsEstimatorType
abstract type AbstractShrunkExpectedReturnsEstimator <: AbstractExpectedReturnsEstimator end

Abstract supertype for all shrunk expected returns estimators in PortfolioOptimisers.jl.

All concrete types implementing shrinkage-based expected returns estimation algorithms should subtype AbstractShrunkExpectedReturnsEstimator. This enables a consistent interface for shrinkage estimators throughout the package.

Related

source
PortfolioOptimisers.AbstractShrunkExpectedReturnsAlgorithmType
abstract type AbstractShrunkExpectedReturnsAlgorithm <: AbstractExpectedReturnsAlgorithm end

Abstract supertype for all shrinkage algorithms for expected returns estimation.

All concrete types implementing specific shrinkage algorithms (e.g., James-Stein, Bayes-Stein) should subtype AbstractShrunkExpectedReturnsAlgorithm. This enables flexible extension and dispatch of shrinkage routines.

Related

source
PortfolioOptimisers.AbstractShrunkExpectedReturnsTargetType
abstract type AbstractShrunkExpectedReturnsTarget <: AbstractExpectedReturnsAlgorithm end

Abstract supertype for all shrinkage targets used in expected returns estimation.

Concrete types implementing specific shrinkage targets (e.g., grand mean, volatility-weighted mean) should subtype AbstractShrunkExpectedReturnsTarget. This enables modular selection of shrinkage targets in shrinkage algorithms.

Related

source
PortfolioOptimisers.GrandMeanType
struct GrandMean <: AbstractShrunkExpectedReturnsTarget end

Shrinkage target representing the grand mean of expected returns.

GrandMean computes the shrinkage target as the mean of all asset expected returns, resulting in a vector where each element is the same grand mean value. This is commonly used in shrinkage estimators to reduce estimation error by pulling individual expected returns toward the overall average.

Related

source
PortfolioOptimisers.VolatilityWeightedType
struct VolatilityWeighted <: AbstractShrunkExpectedReturnsTarget end

Shrinkage target representing the volatility-weighted mean of expected returns.

VolatilityWeighted computes the shrinkage target as a weighted mean of expected returns, where weights are inversely proportional to asset volatility (from the inverse covariance matrix). This approach accounts for differences in asset risk when estimating the shrinkage target.

Related

source
PortfolioOptimisers.MeanSquareErrorType
struct MeanSquareError <: AbstractShrunkExpectedReturnsTarget end

Shrinkage target representing the mean squared error of expected returns.

MeanSquareError computes the shrinkage target as the trace of the covariance matrix divided by the number of observations, resulting in a vector where each element is the same value. This target is useful for certain shrinkage estimators that minimize mean squared error.

Related

source
PortfolioOptimisers.JamesSteinType
struct JamesStein{T1} <: AbstractShrunkExpectedReturnsAlgorithm
    target::T1
end

Shrinkage algorithm implementing the James-Stein estimator for expected returns.

JamesStein applies shrinkage to asset expected returns by pulling them toward a specified target (e.g., grand mean, volatility-weighted mean). The estimator reduces estimation error, especially in high-dimensional settings.

Fields

  • target::AbstractShrunkExpectedReturnsTarget: The shrinkage target type.

Constructor

JamesStein(; target::AbstractShrunkExpectedReturnsTarget = GrandMean())

Construct a JamesStein shrinkage algorithm with the specified target.

Related

source
PortfolioOptimisers.BayesSteinType
struct BayesStein{T1} <: AbstractShrunkExpectedReturnsAlgorithm
    target::T1
end

Shrinkage algorithm implementing the Bayes-Stein estimator for expected returns.

BayesStein applies shrinkage to asset expected returns by pulling them toward a specified target (e.g., grand mean, volatility-weighted mean) using Bayesian principles. This estimator is useful for reducing estimation error, especially when sample sizes are small.

Fields

  • target::AbstractShrunkExpectedReturnsTarget: The shrinkage target type.

Constructor

BayesStein(; target::AbstractShrunkExpectedReturnsTarget = GrandMean())

Construct a BayesStein shrinkage algorithm with the specified target.

Related

source
PortfolioOptimisers.BodnarOkhrinParolyaType
struct BodnarOkhrinParolya{T1} <: AbstractShrunkExpectedReturnsAlgorithm
    target::T1
end

Shrinkage algorithm implementing the Bodnar-Okhrin-Parolya estimator for expected returns.

BodnarOkhrinParolya applies shrinkage to asset expected returns by pulling them toward a specified target (e.g., grand mean, volatility-weighted mean) using the Bodnar-Okhrin-Parolya approach. This estimator is designed for robust estimation in high-dimensional settings.

Fields

  • target::AbstractShrunkExpectedReturnsTarget: The shrinkage target type.

Constructor

BodnarOkhrinParolya(; target::AbstractShrunkExpectedReturnsTarget = GrandMean())

Construct a BodnarOkhrinParolya shrinkage algorithm with the specified target.

Related

source
PortfolioOptimisers.BodnarOkhrinParolyaMethod
BodnarOkhrinParolya(; target::AbstractShrunkExpectedReturnsTarget = GrandMean())

Construct a BodnarOkhrinParolya shrinkage algorithm for expected returns estimation.

Arguments

  • target::AbstractShrunkExpectedReturnsTarget: The shrinkage target.

ReturnsResult

  • BodnarOkhrinParolya: Configured Bodnar-Okhrin-Parolya shrinkage algorithm.

Examples

julia> BodnarOkhrinParolya()
BodnarOkhrinParolya
  target | GrandMean()

Related

source
PortfolioOptimisers.ShrunkExpectedReturnsType
struct ShrunkExpectedReturns{T1, T2, T3} <: AbstractShrunkExpectedReturnsEstimator
    me::T1
    ce::T2
    alg::T3
end

Container type for shrinkage-based expected returns estimators.

ShrunkExpectedReturns encapsulates all components required for shrinkage estimation of expected returns, including the mean estimator, covariance estimator, and shrinkage algorithm. This enables modular and extensible workflows for robust expected returns estimation using shrinkage techniques.

Fields

  • me::AbstractExpectedReturnsEstimator: Mean estimator for expected returns.
  • ce::StatsBase.CovarianceEstimator: Covariance estimator.
  • alg::AbstractShrunkExpectedReturnsAlgorithm: Shrinkage algorithm (e.g., James-Stein, Bayes-Stein).

Constructor

ShrunkExpectedReturns(; me::AbstractExpectedReturnsEstimator = SimpleExpectedReturns(),
                       ce::StatsBase.CovarianceEstimator = PortfolioOptimisersCovariance(),
                       alg::AbstractShrunkExpectedReturnsAlgorithm = JamesStein())

Construct a ShrunkExpectedReturns estimator with the specified mean estimator, covariance estimator, and shrinkage algorithm.

Related

source
PortfolioOptimisers.ShrunkExpectedReturnsMethod
ShrunkExpectedReturns(; me::AbstractExpectedReturnsEstimator = SimpleExpectedReturns(),
                       ce::StatsBase.CovarianceEstimator = PortfolioOptimisersCovariance(),
                       alg::AbstractShrunkExpectedReturnsAlgorithm = JamesStein())

Construct a ShrunkExpectedReturns estimator for shrinkage-based expected returns estimation.

Arguments

  • me::AbstractExpectedReturnsEstimator: Mean estimator for expected returns.
  • ce::StatsBase.CovarianceEstimator: Covariance estimator.
  • alg::AbstractShrunkExpectedReturnsAlgorithm: Shrinkage algorithm.

ReturnsResult

  • ShrunkExpectedReturns: Configured shrinkage-based expected returns estimator.

Examples

julia> ShrunkExpectedReturns()
ShrunkExpectedReturns
   me | SimpleExpectedReturns
      |   w | nothing
   ce | PortfolioOptimisersCovariance
      |   ce | Covariance
      |      |    me | SimpleExpectedReturns
      |      |       |   w | nothing
      |      |    ce | GeneralWeightedCovariance
      |      |       |   ce | StatsBase.SimpleCovariance: StatsBase.SimpleCovariance(true)
      |      |       |    w | nothing
      |      |   alg | Full()
      |   mp | DefaultMatrixProcessing
      |      |       pdm | Posdef
      |      |           |   alg | UnionAll: NearestCorrelationMatrix.Newton
      |      |   denoise | nothing
      |      |    detone | nothing
      |      |       alg | nothing
  alg | JamesStein
      |   target | GrandMean()

Related

source
PortfolioOptimisers.target_meanFunction
target_mean(::GrandMean, mu, sigma; kwargs...)
target_mean(::VolatilityWeighted, mu, sigma; isigma = nothing, kwargs...)
target_mean(::MeanSquareError, mu, sigma; T, kwargs...)

Compute the shrinkage target vector for expected returns estimation.

target_mean calculates the target vector toward which expected returns are shrunk, based on the specified shrinkage target type. This function is used internally by shrinkage estimators such as James-Stein, Bayes-Stein, and Bodnar-Okhrin-Parolya.

Arguments

  • target::GrandMean: ReturnsResult a vector filled with the mean of mu.
  • target::VolatilityWeighted: ReturnsResult a vector filled with the volatility-weighted mean of mu, using the inverse covariance matrix.
  • target::MeanSquareError: ReturnsResult a vector filled with the trace of sigma divided by T.
  • mu::AbstractArray: Vector of expected returns.
  • sigma::AbstractMatrix: Covariance matrix of asset returns.
  • kwargs...: Additional keyword arguments, such as T (number of observations) or isigma (inverse covariance matrix).

ReturnsResult

  • b::AbstractArray: Target vector for shrinkage estimation.

Methods

  • target_mean(::GrandMean, mu, sigma; kwargs...): ReturnsResult a vector filled with the grand mean of mu.
  • target_mean(::VolatilityWeighted, mu, sigma; isigma = nothing, kwargs...): ReturnsResult a vector filled with the volatility-weighted mean of mu, using the inverse covariance matrix.
  • target_mean(::MeanSquareError, mu, sigma; T, kwargs...): ReturnsResult a vector filled with the trace of sigma divided by T.

Related

source
Statistics.meanMethod
mean(me::ShrunkExpectedReturns{<:Any, <:Any, <:JamesStein}, X::AbstractArray; dims::Int = 1, kwargs...)
mean(me::ShrunkExpectedReturns{<:Any, <:Any, <:BayesStein}, X::AbstractArray; dims::Int = 1, kwargs...)
mean(me::ShrunkExpectedReturns{<:Any, <:Any, <:BodnarOkhrinParolya}, X::AbstractArray; dims::Int = 1, kwargs...)

Compute shrunk expected returns using the specified estimator.

This method applies a shrinkage algorithm to the sample expected returns, pulling them toward a specified target to reduce estimation error, especially in high-dimensional settings.

Arguments

  • me::ShrunkExpectedReturns{<:Any, <:Any, <:JamesStein}: Use the James-Stein algorithm.
  • me::ShrunkExpectedReturns{<:Any, <:Any, <:BayesStein}: Use the Bayes-Stein algorithm.
  • me::ShrunkExpectedReturns{<:Any, <:Any, <:BodnarOkhrinParolya}: Use the Bodnar-Okhrin-Parolya algorithm.
  • X::AbstractArray: Data matrix (observations × assets).
  • dims::Int: Dimension along which to compute the mean.
  • kwargs...: Additional keyword arguments passed to the mean and covariance estimators.

ReturnsResult

  • mu::AbstractArray: Shrunk expected returns vector.

Details

  • Computes the sample mean and covariance.

  • Computes the shrinkage target using target_mean.

  • Computes the shrinkage intensity alpha with:

    • JamesStein: the centered mean and eigenvalues of the covariance matrix.
    • BayesStein: a Bayesian formula involving the centered mean and inverse covariance.
    • BodnarOkhrinParolya: a Bayesian formula involving the target mean, mean and inverse covariance.
  • ReturnsResult the shrunk mean vector.

Related

source