Standard deviation expected returns
PortfolioOptimisers.StandardDeviationExpectedReturns Type
struct StandardDeviationExpectedReturns{__T_ce} <: AbstractExpectedReturnsEstimatorExpected 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
StandardDeviationExpectedReturns(;
ce::StatsBase.CovarianceEstimator = PortfolioOptimisersCovariance()
) -> StandardDeviationExpectedReturnsKeywords 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 viafactory.
View parameters
When port_opt_view is called on this type, the following @vprop-tagged fields are automatically subset to the selected indices:
ce: Recursively viewed viaport_opt_view.
Examples
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
sourceStatistics.mean Method
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
Where:
: Standard deviation of asset . : Bias correction ( if corrected = true, else). : Number of observations. : 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)ifdims == 1or(N, 1)ifdims == 2.
Related
sourcePortfolioOptimisers.VarianceExpectedReturns Type
struct VarianceExpectedReturns{__T_ce} <: AbstractExpectedReturnsEstimatorExpected 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
VarianceExpectedReturns(;
ce::StatsBase.CovarianceEstimator = PortfolioOptimisersCovariance()
) -> VarianceExpectedReturnsKeywords 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 viafactory.
View parameters
When port_opt_view is called on this type, the following @vprop-tagged fields are automatically subset to the selected indices:
ce: Recursively viewed viaport_opt_view.
Examples
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
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.
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> factory(nothing, 1, 2; x = 3)
julia> factory(MeanValue())
MeanValue
w ┴ nothingRelated
sourceStatistics.mean Method
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)ifdims == 1or(N, 1)ifdims == 2.
Related
source