Near optimal centering (b)
PortfolioOptimisers._optimise — Function
_optimise(noc::NearOptimalCentering, rd::ReturnsResult = ReturnsResult();
str_names::Bool = false, save::Bool = true, blocks::Tuple = (),
kwargs...) -> NearOptimalCenteringResultBuild the model of a NearOptimalCentering, solve it, and return its result.
optimise reaches this method through shared_series_solve, which drops the observations of a Shared Series gap before the solve.
Algorithm
- Replace each schedule of
nocwith its static default throughreset_time_dependent_estimator. - Solve the anchor portfolios and find the bounds of the near optimal region with
near_optimal_centering_setup, with the blocks ofblocks, givingsetup. It holds the anchor weights, their return codes, the inner optimiseroptand its resolved bundleattrs. - Take the view of
nocand ofrdat the investable assets withinvestable_view. Both are unchanged when every asset is investable. - Build a new model. Register the scales of
optwithset_model_scales!, the number of observations of the prior withset_model_observations!, the expressionk = 1withset_maximum_ratio_factor_variables!, and the weights withset_w!. The weights start at the optimal anchor whenw_optis one weight vector. A vector of anchors, of a sweep, sets no start value. - Add the rows of the variant
noc.algwithassemble_near_optimal_centering_model!. - Solve the barrier with
solve_near_optimal_centering!, givingnoc_retcodeandsol. - Combine the return codes of the three anchors and of the barrier with
get_overall_retcode, givingretcode. - Build the result. It holds
attrs,retcode,sol, the model whensaveistrue, the risk measures resolved against the prior, and the four return codes.
Arguments
noc::NearOptimalCentering: The optimiser.rd: The returns result to use. Whennoc.opt.peis a prior result, the solve does not readrd. A fallback or a clustering step can still read it.str_names::Bool:truegives each variable and each row of the model its string name.save::Bool:truekeeps the model in the result.blocks::Tuple = (): The blocks after the block of the optimiser of the head, the keywordblocksofresolve_jump_optimiser. The head adds the rows of every block to its model withassemble_jump_model!. The fallback chain ofoptimisepasses the keyword to each member, so a fallback solves on the same blocks.kwargs...: Passed on tonear_optimal_centering_setup.
Returns
NearOptimalCenteringResult: The result, withfb = nothing.optimiseruns the fallback chain when the solve fails.
Related