optimization

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

optimization

Ben Nachtrieb
Hello,

I'm looking for the best multi-parameter optimization methods in R that:

1) Use brute force (non-genetic parameter value selection, i.e. tests all
parameter combinations...) to see results for all combinations of parameter
values requested by the user.

2) Use a genetic algorithm (skips some parameter value combinations via a
genetic algorithm selection process...) to speed up the optimization
process.

Yes, #1 and #2 above conflict, thus I would like to test both types of
optimizations.

I am optimizing trading program parameters over time series data (package
timeSeries) and I'd like to avoid re-inventing the wheel (save myself some
coding time). I have a back testing function that I can use in the
optimization function.

I have been here:
http://cran.r-project.org/web/views/Optimization.html

And it is looking like optim() is my best bet; however, I want to double
check with the community first.

Thanks!

--
Ben Nachtrieb
M.S.Finance / Investment Management, University of Denver
Beta Gamma Sigma member

        [[alternative HTML version deleted]]

_______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- Subscriber-posting only. If you want to post, subscribe first.
-- Also note that this is not the r-help list where general R questions should go.
Reply | Threaded
Open this post in threaded view
|

!SPAM: Re: optimization

braverock
On 07/17/2010 04:56 PM, Ben Nachtrieb wrote:
> Hello,
>
> I'm looking for the best multi-parameter optimization methods in R that:
>
> 1) Use brute force (non-genetic parameter value selection, i.e. tests all
> parameter combinations...) to see results for all combinations of parameter
> values requested by the user.

You'd need to be sure the problem was tractable given the possible numbers of
calculations.  This number can easily get into the billions or more.

If tractable, it is just a nested loop to test all the parameters. brute force
optimizers tend to be specific to your problem, and not very reusable, but easy
to write.

You may also want to consider Burns-style random portfolios or a variant for
parameters. This would allow you to cover the space and get a representative
sample.  See Pat Burns' papers.

> 2) Use a genetic algorithm (skips some parameter value combinations via a
> genetic algorithm selection process...) to speed up the optimization
> process.

DEoptim is the best available in R for this at this point, in my opinion.

> Yes, #1 and #2 above conflict, thus I would like to test both types of
> optimizations.
>
> I am optimizing trading program parameters over time series data (package
> timeSeries) and I'd like to avoid re-inventing the wheel (save myself some
> coding time). I have a back testing function that I can use in the
> optimization function.

There is no pre-built parameter optimization mechanism tuned towards trading
strategy parameters in R at this time.  I've done it with brute force, random
search (see the random portfolio code in PortfolioAnalytics, it could be
modified), and DEoptim.  I have not generalized it yet.

> I have been here:
> http://cran.r-project.org/web/views/Optimization.html
>
> And it is looking like optim() is my best bet; however, I want to double
> check with the community first.

With any non-smooth surface, optim will give local minima that may not be the
global optimum.  See optim()'s performance on Rastrigen, for example.

Regards,

   - Brian

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

_______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- Subscriber-posting only. If you want to post, subscribe first.
-- Also note that this is not the r-help list where general R questions should go.