Skip to content
18

Standard deviation expected returns

PortfolioOptimisers.StandardDeviationExpectedReturns Type
julia
struct StandardDeviationExpectedReturns{__T_ce} <: AbstractExpectedReturnsEstimator

Expected returns estimator that returns the asset standard deviations.

StandardDeviationExpectedReturns computes "expected returns" as the standard deviation of each asset, as estimated by the underlying covariance estimator. This can be useful in certain risk-based portfolio construction approaches where the expected return proxy is the asset's volatility.

Fields

  • ce: Covariance estimator.

Constructors

julia
StandardDeviationExpectedReturns(;
    ce::StatsBase.CovarianceEstimator = PortfolioOptimisersCovariance()
) -> StandardDeviationExpectedReturns

Keywords correspond to the struct's fields.

Propagated parameters

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

  • ce: 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> StandardDeviationExpectedReturns()
StandardDeviationExpectedReturns
  ce ┼ PortfolioOptimisersCovariance
     │   ce ┼ Covariance
     │      │    me ┼ SimpleExpectedReturns
     │      │       │   w ┴ nothing
     │      │    ce ┼ GeneralCovariance
     │      │       │   ce ┼ StatsBase.SimpleCovariance: StatsBase.SimpleCovariance(true)
     │      │       │    w ┴ nothing
     │      │   alg ┴ FullMoment()
     │   mp ┼ MatrixProcessing
     │      │     pdm ┼ Posdef
     │      │         │      alg ┼ UnionAll: NearestCorrelationMatrix.Newton
     │      │         │   kwargs ┴ @NamedTuple{}: NamedTuple()
     │      │      dn ┼ nothing
     │      │      dt ┼ nothing
     │      │     alg ┼ nothing
     │      │   order ┴ NTuple{4, Symbol}: (:pdm, :dn, :dt, :alg)

Related

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

Compute expected returns as the standard deviation of each asset.

This method returns the standard deviation vector of X as estimated by the covariance estimator me.ce.

Mathematical definition

μ^j=σ^j=1Tct=1Twt(rtjμ^j(0))2.

Where:

  • σ^j: Standard deviation of asset j.

  • c: Bias correction (c=1 if corrected = true, else c=0).

  • T: Number of observations.

  • wt: Observation weights.

Arguments

  • me: Standard deviation expected returns estimator.

  • X: Data matrix of asset returns (observations × assets).

  • dims: Dimension along which to perform the computation.

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

Returns

  • mu::Matrix{<:Number}: Standard deviation vector, shaped as (1, N) if dims == 1 or (N, 1) if dims == 2.

Related

source
PortfolioOptimisers.VarianceExpectedReturns Type
julia
struct VarianceExpectedReturns{__T_ce} <: AbstractExpectedReturnsEstimator

Expected returns estimator that returns the asset variances.

VarianceExpectedReturns computes "expected returns" as the variance of each asset, as estimated by the underlying covariance estimator. This can be useful in certain risk-based portfolio construction approaches where the expected return proxy is the asset's variance. Variance is the square of volatility (standard deviation).

Fields

  • ce: Covariance estimator.

Constructors

julia
VarianceExpectedReturns(;
    ce::StatsBase.CovarianceEstimator = PortfolioOptimisersCovariance()
) -> VarianceExpectedReturns

Keywords correspond to the struct's fields.

Propagated parameters

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

  • ce: 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> VarianceExpectedReturns()
VarianceExpectedReturns
  ce ┼ PortfolioOptimisersCovariance
     │   ce ┼ Covariance
     │      │    me ┼ SimpleExpectedReturns
     │      │       │   w ┴ nothing
     │      │    ce ┼ GeneralCovariance
     │      │       │   ce ┼ StatsBase.SimpleCovariance: StatsBase.SimpleCovariance(true)
     │      │       │    w ┴ nothing
     │      │   alg ┴ FullMoment()
     │   mp ┼ MatrixProcessing
     │      │     pdm ┼ Posdef
     │      │         │      alg ┼ UnionAll: NearestCorrelationMatrix.Newton
     │      │         │   kwargs ┴ @NamedTuple{}: NamedTuple()
     │      │      dn ┼ nothing
     │      │      dt ┼ nothing
     │      │     alg ┼ nothing
     │      │   order ┴ NTuple{4, Symbol}: (:pdm, :dn, :dt, :alg)

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.

factory and port_opt_view are the two propagation mechanisms in this library. They are duals: factory threads runtime values (prior moments, observation weights, previous portfolio weights) down through a composed struct tree; port_opt_view threads an index selection (a subset of assets or observations) down through the same tree.

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::VarianceExpectedReturns, X::MatNum;
                dims::Int = 1, kwargs...)

Compute expected returns as the variance of each asset.

This method returns the variance vector of X as estimated by the covariance estimator me.ce.

Arguments

  • me: Variance expected returns estimator.

  • X: Data matrix of asset returns (observations × assets).

  • dims: Dimension along which to perform the computation.

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

Returns

  • mu::Matrix{<:Number}: Variance vector, shaped as (1, N) if dims == 1 or (N, 1) if dims == 2.

Related

source