Skip to content
13

Excess expected returns

PortfolioOptimisers.ExcessExpectedReturns Type
julia
struct ExcessExpectedReturns{__T_me, __T_rf} <: AbstractShrunkExpectedReturnsEstimator

Container type for excess expected returns estimators.

ExcessExpectedReturns encapsulates a mean estimator and a risk-free rate for computing excess expected returns.

Fields

  • me: Expected returns estimator.

  • rf: Risk-free rate.

Constructors

julia
ExcessExpectedReturns(;
    me::AbstractExpectedReturnsEstimator = SimpleExpectedReturns(),
    rf::Number = 0.0
) -> ExcessExpectedReturns

Keywords correspond to the struct's fields.

Propagated parameters

When factory is called on this type, the following @fprop-tagged fields are automatically propagated:

  • me: Recursively updated via factory.

View parameters

When port_opt_view is called on this type, the following @vprop-tagged fields are automatically subset to the selected indices:

Examples

julia
julia> ExcessExpectedReturns()
ExcessExpectedReturns
  me ┼ SimpleExpectedReturns
     │   w ┴ nothing
  rf ┴ Float64: 0.0

Related

source
PortfolioOptimisers.factory Method
julia
factory(a::Union{Nothing, <:AbstractEstimator, <:AbstractAlgorithm,
                 <:AbstractResult}, args...; kwargs...) -> a

No-op factory function for constructing objects with a uniform interface.

Defining methods which dispatch on the first argument allows for a consistent factory interface across different types.

Arguments

  • a: Indicates no object should be constructed.

  • args...: Arbitrary positional arguments (ignored).

  • kwargs...: Arbitrary keyword arguments (ignored).

Returns

  • a: The input unchanged.

Examples

julia
julia> factory(nothing, 1, 2; x = 3)

julia> factory(MeanValue())
MeanValue
  w ┴ nothing

Related

source
Statistics.mean Method
julia
Statistics.mean(me::ExcessExpectedReturns, X::MatNum; dims::Int = 1, kwargs...)

Compute excess expected returns by subtracting the risk-free rate.

This method applies the mean estimator to the data and subtracts the risk-free rate from the resulting expected returns.

Mathematical definition

μ^excess=μ^rf1.

Where:

  • μ^excess: N×1 vector of excess expected returns.

  • μ^: N×1 vector of estimated expected returns.

  • rf: Risk-free rate.

  • 1: N×1 vector of ones.

Arguments

  • me: Excess expected returns estimator.

  • X: Data matrix (observations × assets).

  • dims: Dimension along which to perform the computation.

  • kwargs...: Additional keyword arguments passed to the mean estimator.

Returns

  • mu::ArrNum: Excess expected returns vector.

Examples

julia
julia> me = ExcessExpectedReturns(; rf = 0.01);

julia> X = [0.01 0.02; 0.03 0.04; 0.02 0.03];

julia> mean(me, X)
1×2 Matrix{Float64}:
 0.01  0.02

Related

source