[GSoC-PortA] Issue passing "clean"?

Peter Carl peter at braverock.com
Wed Oct 9 22:38:12 CEST 2013


Ross,

I'm running into the following:

> buoys.portfmeas
                Mean      StdDev       mETL
MinSD    0.005435103 0.009286484 0.01357282
MinmETL  0.005846839 0.011196709 0.01371471

Note that the minimum standard deviation portfolio has a lower mETL than
the Min mETL portfolio.  Both were calculated with ROI.

MinSD.portf <- add.objective(portfolio=init.portf,
  type="risk", # the kind of objective this is
  name="var", # name of the function
  arguments=list(clean=clean)
)

> MinSD.ROI<-optimize.portfolio(R=R,
+   portfolio=MinSD.portf,
+   optimize_method='ROI'
+   )
Warning message:
In constrained_objective(w = weights, R = R, portfolio, trace = TRUE,  :
  some arguments stored for var do not match

That warning is true, "var" doesn't take that list of arguments, including
"clean".  But when I use name="StdDev" in the portfolio construction, I
get the following error:

Error in optimize.portfolio(R = R, portfolio = MinSD.portf,
optimize_method = "ROI") :
  ROI only solves mean, var, or sample ETL/ES/CVaR type business
objectives, choose a different optimize_method.
In addition: Warning message:
In is.na(le) : is.na() applied to non-(list or vector) of type 'NULL'

So the first issue is to map "StdDev" into the list of acceptable
functions for that solver.  It should then accept the "clean" argument and
that should fix part of the issue.

The second issue is that the Min mETL portfolio being identified isn't
being plotted as the minimum mETL portfolio being identified in the cloud
of random portfolios.  This is the same issue I saw earlier that turned
out to be related to "clean" not being applied consistently across
objectives.

In this case, it should be:
p=1-1/12
clean="boudt"
MinmETL.portf <- add.objective(portfolio=init.portf,
  type="risk", # the kind of objective this is
  name="ES", # the function to minimize
  arguments=list(p=p, clean=clean)
)

> MinmETL.ROI<-optimize.portfolio(R=R,
+   portfolio=MinmETL.portf,
+   optimize_method='ROI',
+   trace=TRUE, verbose=TRUE
+   )
Warning message:
In is.na(le) : is.na() applied to non-(list or vector) of type 'NULL'

I'm not sure if the warning is related.  But I'm wondering if "clean" is
getting passed into "ES" with ROI.  If it isn't, then the optimizer is
likely selecting the wrong portfolio.  Could you take a look at this when
you have a moment?

Thanks,

pcc
-- 
Peter Carl
http://www.braverock.com/peter




More information about the GSoC-PortA mailing list