Excess expected returns
PortfolioOptimisers.ExcessExpectedReturns Type
struct ExcessExpectedReturns{__T_me, __T_rf} <: AbstractShrunkExpectedReturnsEstimatorContainer 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
ExcessExpectedReturns(;
me::AbstractExpectedReturnsEstimator = SimpleExpectedReturns(),
rf::Number = 0.0
) -> ExcessExpectedReturnsKeywords 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 viafactory.
View parameters
When port_opt_view is called on this type, the following @vprop-tagged fields are automatically subset to the selected indices:
me: Recursively viewed viaport_opt_view.
Examples
julia> ExcessExpectedReturns()
ExcessExpectedReturns
me ┼ SimpleExpectedReturns
│ w ┴ nothing
rf ┴ Float64: 0.0Related
sourcePortfolioOptimisers.factory Method
factory(a::Union{Nothing, <:AbstractEstimator, <:AbstractAlgorithm,
<:AbstractResult}, args...; kwargs...) -> aNo-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> factory(nothing, 1, 2; x = 3)
julia> factory(MeanValue())
MeanValue
w ┴ nothingRelated
sourceStatistics.mean Method
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
Where:
: vector of excess expected returns. : vector of estimated expected returns. : Risk-free rate. : 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> 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.02Related
source