Turnover risk measure
PortfolioOptimisers.TurnoverRiskMeasure Type
struct TurnoverRiskMeasure{__T_settings, __T_w, __T_fixed} <: RiskMeasureRepresents the Turnover risk measure.
TurnoverRiskMeasure penalises portfolio rebalancing by measuring the
Mathematical definition
Let
Where:
: Portfolio turnover. : Portfolio weights vector . : Reference (previous or target) portfolio weights vector . : Number of assets.
Fields
settings: Risk measure settings.w: Reference portfolio weights vector.fixed: Whether the estimator is fixed and does not update with new weights.
Constructors
TurnoverRiskMeasure(;
settings::RiskMeasureSettings = RiskMeasureSettings(),
w::VecNum,
fixed::Bool = false
) -> TurnoverRiskMeasureKeywords correspond to the struct's fields.
Validation
!isempty(w).
Functor
(r::TurnoverRiskMeasure)(w::VecNum)Computes the Turnover risk of a portfolio weight vector w.
Arguments
w::VecNum: New portfolio weights vector.
Examples
julia> TurnoverRiskMeasure(; w = [0.5, 0.5])
TurnoverRiskMeasure
settings ┼ RiskMeasureSettings
│ scale ┼ Float64: 1.0
│ ub ┼ nothing
│ rke ┴ Bool: true
w ┼ Vector{Float64}: [0.5, 0.5]
fixed ┴ Bool: falseRelated
sourcePortfolioOptimisers.port_opt_view Method
port_opt_view(
r::TurnoverRiskMeasure,
i,
args...
) -> TurnoverRiskMeasure{RiskMeasureSettings{__T_scale, __T_ub, __T_rke}, <:AbstractVector{var"#s21"}, Bool} where {__T_scale, __T_ub, __T_rke, var"#s21"<:(Union{var"#s20", var"#s19"} where {var"#s20"<:Number, var"#s19"<:AbstractJuMPScalar})}Return a view of TurnoverRiskMeasure r sliced to the asset indices i.
Used for cluster-based optimisation where only a subset of assets is considered.
Related
sourcePortfolioOptimisers.needs_previous_weights Method
needs_previous_weights(r::TurnoverRiskMeasure) -> AnyReturn whether TurnoverRiskMeasure r requires previous portfolio weights.
Returns true if r.fixed is false (i.e., the reference weights are updated each period).
Related
sourcePortfolioOptimisers.factory Method
factory(
r::TurnoverRiskMeasure,
w::AbstractVector{<:Union{var"#s20", var"#s19"} where {var"#s20"<:Number, var"#s19"<:AbstractJuMPScalar}}
) -> TurnoverRiskMeasureCreate an instance of TurnoverRiskMeasure updating the reference weights to w.
If r.fixed is true, returns r unchanged. Otherwise, constructs a new instance with w as the reference weight vector.
Related
sourcePortfolioOptimisers.factory Function
factory(
r::TurnoverRiskMeasure,
,
,
;
...
) -> TurnoverRiskMeasure
factory(
r::TurnoverRiskMeasure,
,
,
,
w::Union{Nothing, AbstractVector{<:Union{var"#s20", var"#s19"} where {var"#s20"<:Number, var"#s19"<:AbstractJuMPScalar}}},
args...;
kwargs...
) -> TurnoverRiskMeasureCreate an instance of TurnoverRiskMeasure from a full optimisation context, forwarding the optional weight argument w to factory(r, w).
Ignores prior result, solver, and uncertainty set arguments — only w is used.
Related
source