Tracking risk measure: private API

PortfolioOptimisers.bind_data_benchmark — Method
bind_data_benchmark(r::TrackingRiskMeasure, rd)
bind_data_benchmark(r::Union{RiskTrackingError, RiskTrackingRiskMeasure}, rd)

Bind the DataBenchmarkTracking that a tracking measure holds to the benchmark B of the returns data rd.

A TrackingRiskMeasure binds its tr field. A RiskTrackingError and a RiskTrackingRiskMeasure track a benchmark portfolio, so they bind the measure r that they track. Each rebuilds through its keyword constructor only when the field changes, as bind_data_benchmark states.

Algorithm

  1. Bind the field that can hold a data benchmark with bind_data_benchmark: tr of a TrackingRiskMeasure, giving tr, or the tracked measure r of the two risk trackers, giving inner.
  2. Return r itself when the bound field is the field it replaces, by ===.
  3. Otherwise rebuild r with the bound field through its keyword constructor, with rebuild_struct.

Related

source
PortfolioOptimisers.reader_frames — Method
reader_frames(r::Union{RiskTrackingError, RiskTrackingRiskMeasure},
              path::AbstractString, refit::Bool)

Return the frames that the tracked measure of a risk tracker adds to the group of the optimiser that holds the tracker.

A RiskTrackingError and a RiskTrackingRiskMeasure hold the measure that they track in r, so the walk passes through to it at the path "<path>.r". A measure that holds a reader, such as an UncertaintySetVariance with a prior of its own, adds the frames of that reader. A TrackingError and a TrackingRiskMeasure hold no reader, so they add no frames.

Arguments

  • r: The risk tracker.
  • path: The path of the value from the head, for example "pe", "cle" or "r[2].pe". A warning names a reader by its path.
  • refit: true when a regression reader at x_src = nothing in the group fits its regression on the raw returns data. refits_regression finds the value.

Returns

  • fr::ReturnsFrames: The frames of the tracked measure.

Related

source