Skip to content
5

Expected Risk

PortfolioOptimisers.expected_risk Functionsource
julia
expected_risk(r::ReturnRiskMeasure, w::AbstractVector{<:Real}, pr::AbstractPriorResult;
              fees::Union{Nothing, <:Fees} = nothing, kwargs...)

Compute the expected risk for a portfolio using a return-based risk measure.

expected_risk returns the expected portfolio return as the risk metric, using the specified return estimator in the ReturnRiskMeasure. This is useful for algorithms where risk is defined as expected return.

Arguments

  • r: ReturnRiskMeasure containing a return estimator.

  • w: Portfolio weights.

  • pr: Prior result.

  • fees: Optional transaction fees.

  • kwargs...: Additional keyword arguments.

Returns

  • risk::Real: Expected portfolio return (net of fees if provided).

Related

source
julia
expected_risk(r::RatioRiskMeasure, w::AbstractVector{<:Real}, pr::AbstractPriorResult;
              fees::Union{Nothing, <:Fees} = nothing, kwargs...)

Compute the expected risk for a portfolio using a ratio-based risk measure.

expected_risk returns the risk-adjusted return ratio (e.g., Sharpe ratio) for the portfolio, using the specified return estimator, risk measure, and risk-free rate in the RatioRiskMeasure.

Arguments

  • r: RatioRiskMeasure containing a return estimator, risk measure, and risk-free rate.

  • w: Portfolio weights.

  • pr: Prior result.

  • fees: Optional transaction fees.

  • kwargs...: Additional keyword arguments.

Returns

  • risk::Real: Risk-adjusted return ratio.

Related

source