[GSoC-PortA] Odd Behavior Depending on Order of Objectives
Brian G. Peterson
brian at braverock.com
Mon Sep 23 16:38:34 CEST 2013
On 09/23/2013 09:32 AM, Ross Bennett wrote:
> After running Peter's script in the sandbox/symposium2013, I noticed
> that portfolio component ES and component StdDev were not being returned
> in the $objective_measures slot.
>
> I did some testing and it appears that if a "risk" objective is added
> after a "risk_budget" objective with the same name (e.g. "ES" or
> "StdDev"), the portfolio component contribution is not returned. This
> seems odd to me because constrained_objective loops through the
> objectives and calculates each one separately.
>
> I attached an example script to demonstrate this.
>
> Any thoughts on what is going on here?
The returned object is a named list.
As such, the second objective with the same name overwrites the first.
Both are calculated, but only one will get written.
Dealing with this could be tricky.
On the one hand, the component risk measures *do* calculate the
univariate portfolio risk too. So if we know that they have the same
name, we can just get the correct info from the slots.
On the other hand, it may make for simpler code to rename the second
defined objective, or to rename all objectives to be objectivetype.name
e.g. risk_budget.ETL, risk.ETL or alternately, making the list
multi-level, with objective types being a heirarchy above the individual
objectives.
Without spending time poking at it, I don't know which makes more sense,
special-casing for the risk_budget functions which all have a common
form, or trying to general-case the naming conventions inside the list.
--
Brian G. Peterson
http://braverock.com/brian/
Ph: 773-459-4973
IM: bgpbraverock
More information about the GSoC-PortA
mailing list