Panel collapse

PortfolioOptimisers.calc_net_returns — Function
calc_net_returns(res::OptimisationResult, X::MatNum, fees = nothing, wd = nothing, obs = nothing)
calc_net_returns(res::OptimisationResult, pr::Pr_RR, fees = nothing, wd = nothing, obs = nothing)

Compute net returns for a OptimisationResult.

fees takes precedence over res.fees if both are provided. Delegates to calc_net_returns(w, X, fees, wd, obs).

When pr::Pr_RR is passed, the carrier is paired whole and its X is read after.

The weights, the matrix and the fee meet on the investable universe of res, through result_investable_view: res.w is on the caller's universe and res.fees on the one the fit solved, so the weights and a caller's X are viewed at the result's Investable Mask, and a caller's fees takes the door a fee takes at the fit.

wd is the Weight Drift the window is read under. nothing reads the window at the constant weights res.w, which is the library's original behaviour. A SelfFinancingDrift reads it as the wealth ratio of the drifted holdings, and obs then names the observations of the message a non-positive wealth raises.

Related

source