[GSoC-PortA] Issue passing "clean"?

Ross Bennett rossbennett34 at gmail.com
Thu Oct 10 00:20:16 CEST 2013


Peter,

Thanks for the detailed description of what is going on. I will be able to
dig into this deeper tomorrow afternoon, but here are some initial comments.

See comments in-line.



On Wed, Oct 9, 2013 at 1:38 PM, Peter Carl <peter at braverock.com> wrote:

> 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.
>

Got it, I'll add functionality for StdDev to be accepted by the ROI
solvers. I'll have to add StdDev, but still use "var" to calculate the
variance-covariance matrix used in the objective function. I will also have
to detect the "clean" argument so that the cleaned returns are used to
calculate the variance-covariance matrix.


>
> 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?
>

It could be related, in general, the "clean" argument is not passed to ROI.
I should be able to make some changes so that the cleaned returns are used
for the ROI solvers. I'll take a closer look and report back with my
findings.


>
> Thanks,
>
> pcc
> --
> Peter Carl
> http://www.braverock.com/peter
>
>
> _______________________________________________
> GSoC-PortA mailing list
> GSoC-PortA at lists.r-forge.r-project.org
> http://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/gsoc-porta
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/gsoc-porta/attachments/20131009/cfa36776/attachment.html>


More information about the GSoC-PortA mailing list