Custom value expected returns
PortfolioOptimisers.CustomValueExpectedReturns Type
struct CustomValueExpectedReturns{__T_val} <: AbstractExpectedReturnsEstimatorExpected returns estimator that returns custom values for each asset.
Fields
val: Custom value.- If a scalar, all assets are assigned this value.
If a vector, each element corresponds to an asset.
If a function, it is called with the full
Xmatrix anddims, with additional keyword arguments passed through.
- If a scalar, all assets are assigned this value.
Constructors
CustomValueExpectedReturns(;
val::Func_Num_VecNum = 0.0
) -> CustomValueExpectedReturnsKeywords correspond to the struct's fields.
Examples
julia> CustomValueExpectedReturns()
CustomValueExpectedReturns
val ┴ Float64: 0.0Related
sourceStatistics.mean Method
Statistics.mean(me::CustomValueExpectedReturns, X::MatNum;
dims::Int = 1, kwargs...)Compute expected returns as custom values.
Mathematical definition
Returns a user-supplied constant, vector, or function result as the expected returns:
Where:
: Expected return of asset . : -th element of the custom value me.val(broadcast from a scalar, taken directly from a vector, or evaluated from a callable).: Number of assets.
Arguments
me: Custom value expected returns estimator.X: Data matrix of asset returns (observations × assets).dims: Dimension along which to perform the computation.kwargs...: Additional keyword arguments.
Returns
mu::Matrix{<:Number}: Expected returns matrix, shaped as(1, N)ifdims == 1or(N, 1)ifdims == 2.
Related
sourceStatistics.mean Method
mean(
me::CustomValueExpectedReturns{<:AbstractVector{<:Union{var"#s29", var"#s28"} where {var"#s29"<:Number, var"#s28"<:AbstractJuMPScalar}}},
X::AbstractMatrix{<:Union{var"#s29", var"#s28"} where {var"#s29"<:Number, var"#s28"<:AbstractJuMPScalar}};
dims,
kwargs...
) -> AnyVector overload of mean(me::CustomValueExpectedReturns, X::MatNum; dims::Int = 1, kwargs...). Returns the stored vector me.val reshaped to match dims.
Statistics.mean Method
mean(
me::CustomValueExpectedReturns{<:Function},
X::AbstractMatrix{<:Union{var"#s29", var"#s28"} where {var"#s29"<:Number, var"#s28"<:AbstractJuMPScalar}};
dims,
kwargs...
) -> AnyFunction overload of mean(me::CustomValueExpectedReturns, X::MatNum; dims::Int = 1, kwargs...). Delegates to the callable me.val with the same arguments.