Skip to content
13

Custom value expected returns

PortfolioOptimisers.CustomValueExpectedReturns Type
julia
struct CustomValueExpectedReturns{__T_val} <: AbstractExpectedReturnsEstimator

Expected 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 X matrix and dims, with additional keyword arguments passed through.

Constructors

julia
CustomValueExpectedReturns(;
    val::Func_Num_VecNum = 0.0
) -> CustomValueExpectedReturns

Keywords correspond to the struct's fields.

Examples

julia
julia> CustomValueExpectedReturns()
CustomValueExpectedReturns
  val ┴ Float64: 0.0

Related

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

Compute expected returns as custom values.

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) if dims == 1 or (N, 1) if dims == 2.

Related

source