[GSoC-PortA] Error with clean.boudt when passing arguments for ... in optimize.portfolio

Brian G. Peterson brian at braverock.com
Fri Aug 30 20:11:53 CEST 2013


On 08/29/2013 12:00 PM, Ross Bennett wrote:
> All,
>
> While I was working through examples for risk_budget_objectives, I came
> across a situation that causes an error and I am not sure how to fix it.
> If clean="boudt" is in the arguments list in the objective and an
> argument for ... is passed in optimize.portfolio I am getting an error
> in clean.boudt.
>
> Error in clean.boudt(na.omit(R[, column, drop = FALSE]), alpha = alpha,  :
>                               unused argument(s) (itermax = 50)


It's a little unclear why dots would be passed that deeply anyway.

Typically, in PortfolioAnalytics, we're matching arguments and stripping 
dots before calling the underlying objective functions.

This particular edge case is easily fixed by adding dots to the boudt 
method of Retur.clean, but I'm sure there's a more general solution.

I think we should pick it up in the argument matching, and not expect 
the called functions to be ready to catch any arbitrary arguments.

> Upon insepecting traceback(), it looks like the error is due
> to Return.clean(R, method = objective$arguments.clean, ...) where the
> dots are picking up the dots arguments from optimize.portfolio.
>
> I added sandbox/testing_risk_budget.R in r2931 that has an example to
> reproduce the error. Is there a way to correct this? I suppose a
> workaround is to clean the returns first and not specify clean in the
> arguments list in the objective so the dots argument
> in optimize.portfolio can then be used to control the parameters for the
> solvers.
>
> Any thoughts/suggestions on resolving this?
>
> Thanks,
> Ross
>
>
>
> _______________________________________________
> 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
>


-- 
Brian G. Peterson
http://braverock.com/brian/
Ph: 773-459-4973
IM: bgpbraverock


More information about the GSoC-PortA mailing list