Strategies based on Neural Networks (or SVMs) - any experience with R ?

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

Strategies based on Neural Networks (or SVMs) - any experience with R ?

jondollar
Dear all,


I just send out this post in order to share within r-sig-finance any
possible experience, advice, ... about NNs or SVMs with R.

Several good records have been published in the litterature using these
techniques for financial trading strategies.
There are also commercial packages (expensive !) which seem to have achieved
good results.

So I feel it could be nice to share within this group about the following
subjects :

- experience using the R packages
- data pre-processing before feeding the NNs (technical indicators,
wavelets, EMDs, ....)
- which type of NNs are suitable
- how to build and train them
- etc ...

Thanks to all for sharing within the R community

Best Regards,


Pierre

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

Re: Strategies based on Neural Networks (or SVMs) - any experience with R ?

braverock
On Mon, 2011-08-22 at 10:11 +0200, Gentil Homme wrote:
> I just send out this post in order to share within r-sig-finance any
> possible experience, advice, ... about NNs or SVMs with R.

It seems that you're asking us to share with you, and not sharing much
yourself in return.

Perhaps you could answer your own questions in this thread with the
things you are trying?

SVM's have been discussed on this list many times, please search the
list archives.

This blog has covered this topic:
http://www.aphysicistinwallstreet.com/

Also, there are a few books on machine learning that use R.  

> Several good records have been published in the litterature using these
> techniques for financial trading strategies.

Which ones? References?

> There are also commercial packages (expensive !) which seem to have achieved
> good results.

Which packages?  References again?

Note that neural network strategies are very likely to create look-ahead
bias as you develop and test them.  You try something, fail, and try
again on the same data.  Unless you are very careful to reserve a 'pure'
set of instruments and dates that you won't *ever* touch until you think
you have a 'good' machine learning system, you're at pretty serious risk
of introducing your look-ahead knowledge into the system.  While this is
true to one degree or another in any quantitative strategy development,
I think it is a particular risk in self-adaptive machine learning
methodologies.

 

> So I feel it could be nice to share within this group about the following
> subjects :
>
> - experience using the R packages
> - data pre-processing before feeding the NNs (technical indicators,
> wavelets, EMDs, ....)
> - which type of NNs are suitable
> - how to build and train them
> - etc ...
>
> Thanks to all for sharing within the R community

Now, your turn.  Bring the community up to date with your research so
far.  

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.
Reply | Threaded
Open this post in threaded view
|

Re: Strategies based on Neural Networks (or SVMs) - any experience with R ?

José Fernando Moreno Gutiérrez
R have many packages to apply SVM or KNN. See:

http://cran.r-project.org/web/packages/e1071/vignettes/svmdoc.pdf
http://www.jstatsoft.org/v15/i09/paper
http://www.springer.com/statistics/physical+%26+information+science/book/978-1-4419-9889-7
http://www.springer.com/new+%26+forthcoming+titles+%28default%29?SGWID=10-40356-404-173624787-6991

On 22 August 2011 09:14, Brian G. Peterson <[hidden email]> wrote:

> On Mon, 2011-08-22 at 10:11 +0200, Gentil Homme wrote:
> > I just send out this post in order to share within r-sig-finance any
> > possible experience, advice, ... about NNs or SVMs with R.
>
> It seems that you're asking us to share with you, and not sharing much
> yourself in return.
>
> Perhaps you could answer your own questions in this thread with the
> things you are trying?
>
> SVM's have been discussed on this list many times, please search the
> list archives.
>
> This blog has covered this topic:
> http://www.aphysicistinwallstreet.com/
>
> Also, there are a few books on machine learning that use R.
>
> > Several good records have been published in the litterature using these
> > techniques for financial trading strategies.
>
> Which ones? References?
>
> > There are also commercial packages (expensive !) which seem to have
> achieved
> > good results.
>
> Which packages?  References again?
>
> Note that neural network strategies are very likely to create look-ahead
> bias as you develop and test them.  You try something, fail, and try
> again on the same data.  Unless you are very careful to reserve a 'pure'
> set of instruments and dates that you won't *ever* touch until you think
> you have a 'good' machine learning system, you're at pretty serious risk
> of introducing your look-ahead knowledge into the system.  While this is
> true to one degree or another in any quantitative strategy development,
> I think it is a particular risk in self-adaptive machine learning
> methodologies.
>
>
> > So I feel it could be nice to share within this group about the following
> > subjects :
> >
> > - experience using the R packages
> > - data pre-processing before feeding the NNs (technical indicators,
> > wavelets, EMDs, ....)
> > - which type of NNs are suitable
> > - how to build and train them
> > - etc ...
> >
> > Thanks to all for sharing within the R community
>
> Now, your turn.  Bring the community up to date with your research so
> far.
>
> 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.
>


--
José Fernando Moreno Gutiérrez
Estudiante de Economía
Facultad de Ciencias Económicas
Universidad Nacional de Colombia

“Aún haciendo a un lado la inestabilidad debida a la especulación, está
aquella que resulta de las características de la naturaleza humana”.
JMK...TG

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

Re: Strategies based on Neural Networks (or SVMs) - any experience with R ?

Stephen Choularton-3
In reply to this post by braverock
I think that Gentil should be aware of the /No Free Lunch Theorem/ (Duda
et al., 2001, Wolpert and Macready, 1997).  There are no
context-independent or usage-independent reasons to favor one machine
learning algorithm over another. If one performs better than another, it
is owing to its better fit to the particular problem, not its general
superiority.  If you wish to use these techniques try lots of them:  
certainly neural networks and support vector machines, but also try some
of the ensemble techniques such as bagging, boosting and random forest.  
You can even try the statisticians favorite, logistic regression.  They
are all available in R.

Stephen Choularton Ph.D., FIoD


On 23/08/2011 12:14 AM, Brian G. Peterson wrote:

> On Mon, 2011-08-22 at 10:11 +0200, Gentil Homme wrote:
>> I just send out this post in order to share within r-sig-finance any
>> possible experience, advice, ... about NNs or SVMs with R.
> It seems that you're asking us to share with you, and not sharing much
> yourself in return.
>
> Perhaps you could answer your own questions in this thread with the
> things you are trying?
>
> SVM's have been discussed on this list many times, please search the
> list archives.
>
> This blog has covered this topic:
> http://www.aphysicistinwallstreet.com/
>
> Also, there are a few books on machine learning that use R.
>
>> Several good records have been published in the litterature using these
>> techniques for financial trading strategies.
> Which ones? References?
>
>> There are also commercial packages (expensive !) which seem to have achieved
>> good results.
> Which packages?  References again?
>
> Note that neural network strategies are very likely to create look-ahead
> bias as you develop and test them.  You try something, fail, and try
> again on the same data.  Unless you are very careful to reserve a 'pure'
> set of instruments and dates that you won't *ever* touch until you think
> you have a 'good' machine learning system, you're at pretty serious risk
> of introducing your look-ahead knowledge into the system.  While this is
> true to one degree or another in any quantitative strategy development,
> I think it is a particular risk in self-adaptive machine learning
> methodologies.
>
>
>> So I feel it could be nice to share within this group about the following
>> subjects :
>>
>> - experience using the R packages
>> - data pre-processing before feeding the NNs (technical indicators,
>> wavelets, EMDs, ....)
>> - which type of NNs are suitable
>> - how to build and train them
>> - etc ...
>>
>> Thanks to all for sharing within the R community
> Now, your turn.  Bring the community up to date with your research so
> far.
>
> Regards,
>
>     - Brian
>

_______________________________________________
[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
|

Re: Strategies based on Neural Networks (or SVMs) - any experience with R ?

Patrick Burns-2
As I learned last week at useR,
logistic regression might not be
the statistician's favorite for
much longer: beta regression does
the same thing, but better.  It can
get the heteroscedasticity more
accurately.

On 23/08/2011 04:12, Stephen Choularton wrote:

> I think that Gentil should be aware of the /No Free Lunch Theorem/ (Duda
> et al., 2001, Wolpert and Macready, 1997). There are no
> context-independent or usage-independent reasons to favor one machine
> learning algorithm over another. If one performs better than another, it
> is owing to its better fit to the particular problem, not its general
> superiority. If you wish to use these techniques try lots of them:
> certainly neural networks and support vector machines, but also try some
> of the ensemble techniques such as bagging, boosting and random forest.
> You can even try the statisticians favorite, logistic regression. They
> are all available in R.
>
> Stephen Choularton Ph.D., FIoD
>
>
> On 23/08/2011 12:14 AM, Brian G. Peterson wrote:
>> On Mon, 2011-08-22 at 10:11 +0200, Gentil Homme wrote:
>>> I just send out this post in order to share within r-sig-finance any
>>> possible experience, advice, ... about NNs or SVMs with R.
>> It seems that you're asking us to share with you, and not sharing much
>> yourself in return.
>>
>> Perhaps you could answer your own questions in this thread with the
>> things you are trying?
>>
>> SVM's have been discussed on this list many times, please search the
>> list archives.
>>
>> This blog has covered this topic:
>> http://www.aphysicistinwallstreet.com/
>>
>> Also, there are a few books on machine learning that use R.
>>
>>> Several good records have been published in the litterature using these
>>> techniques for financial trading strategies.
>> Which ones? References?
>>
>>> There are also commercial packages (expensive !) which seem to have
>>> achieved
>>> good results.
>> Which packages? References again?
>>
>> Note that neural network strategies are very likely to create look-ahead
>> bias as you develop and test them. You try something, fail, and try
>> again on the same data. Unless you are very careful to reserve a 'pure'
>> set of instruments and dates that you won't *ever* touch until you think
>> you have a 'good' machine learning system, you're at pretty serious risk
>> of introducing your look-ahead knowledge into the system. While this is
>> true to one degree or another in any quantitative strategy development,
>> I think it is a particular risk in self-adaptive machine learning
>> methodologies.
>>
>>
>>> So I feel it could be nice to share within this group about the
>>> following
>>> subjects :
>>>
>>> - experience using the R packages
>>> - data pre-processing before feeding the NNs (technical indicators,
>>> wavelets, EMDs, ....)
>>> - which type of NNs are suitable
>>> - how to build and train them
>>> - etc ...
>>>
>>> Thanks to all for sharing within the R community
>> Now, your turn. Bring the community up to date with your research so
>> far.
>>
>> Regards,
>>
>> - Brian
>>
>
> _______________________________________________
> [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.
>

--
Patrick Burns
[hidden email]
http://www.burns-stat.com
http://www.portfolioprobe.com/blog
twitter: @portfolioprobe

_______________________________________________
[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
|

Re: Strategies based on Neural Networks (or SVMs) - any experience with R ?

Stephen Choularton-3
In reply to this post by Stephen Choularton-3
I use nnet and it appears to work reasonably 'out of the box' as an algorithm but you get better performance if you play with the parameters to tune it.

svm appears to work best when you select Gaussian so I'm not sure about your assumption.

All these algorithms have similar R calls so its not to difficult to try lots of them out.  Try then out of the box first up.

good luck.

Stephen Choularton Ph.D., FIoD

9999 2226
0413 545 182


On 23/08/2011 4:51 PM, Gentil Homme wrote:
I didn't know about the theorem but it seems reasonable to believe that some techniques are more appropriate than others for modelling/predicting financial data.
It should be because of their nature : non gaussian, non linear, non stationary, ...

I think it's like the usual technical indicators (MACD, Stochastic, etc ... ) which are more or less suitable depending on the market conditions.

What would be your recommended R package for NNs, as there are different possible architecture : GRNN, PNN, SOM ... (see http://en.wikipedia.org/wiki/NeuroSolutions)

Before trying many solutions, maybe it's worth to have some discussion ... there can be another mighty theorem we should all know :-)

Best Rgds,

Pierre



2011/8/23 Stephen Choularton <[hidden email]>
I think that Gentil should be aware of the /No Free Lunch Theorem/ (Duda et al., 2001, Wolpert and Macready, 1997).  There are no context-independent or usage-independent reasons to favor one machine learning algorithm over another. If one performs better than another, it is owing to its better fit to the particular problem, not its general superiority.  If you wish to use these techniques try lots of them:  certainly neural networks and support vector machines, but also try some of the ensemble techniques such as bagging, boosting and random forest.  You can even try the statisticians favorite, logistic regression.  They are all available in R.

Stephen Choularton Ph.D., FIoD



On 23/08/2011 12:14 AM, Brian G. Peterson wrote:
On Mon, 2011-08-22 at 10:11 +0200, Gentil Homme wrote:
I just send out this post in order to share within r-sig-finance any
possible experience, advice, ... about NNs or SVMs with R.
It seems that you're asking us to share with you, and not sharing much
yourself in return.

Perhaps you could answer your own questions in this thread with the
things you are trying?

SVM's have been discussed on this list many times, please search the
list archives.

This blog has covered this topic:
http://www.aphysicistinwallstreet.com/

Also, there are a few books on machine learning that use R.

Several good records have been published in the litterature using these
techniques for financial trading strategies.
Which ones? References?

There are also commercial packages (expensive !) which seem to have achieved
good results.
Which packages?  References again?

Note that neural network strategies are very likely to create look-ahead
bias as you develop and test them.  You try something, fail, and try
again on the same data.  Unless you are very careful to reserve a 'pure'
set of instruments and dates that you won't *ever* touch until you think
you have a 'good' machine learning system, you're at pretty serious risk
of introducing your look-ahead knowledge into the system.  While this is
true to one degree or another in any quantitative strategy development,
I think it is a particular risk in self-adaptive machine learning
methodologies.


So I feel it could be nice to share within this group about the following
subjects :

- experience using the R packages
- data pre-processing before feeding the NNs (technical indicators,
wavelets, EMDs, ....)
- which type of NNs are suitable
- how to build and train them
- etc ...

Thanks to all for sharing within the R community
Now, your turn.  Bring the community up to date with your research so
far.

Regards,

   - Brian


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


No virus found in this message.
Checked by AVG - www.avg.com
Version: 10.0.1392 / Virus Database: 1520/3851 - Release Date: 08/22/11


_______________________________________________
[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
|

Re: Strategies based on Neural Networks (or SVMs) - any experience with R ?

Stephen Choularton-3
Hi Pierre

Don't want to sound unhelpful but I'm afraid my employer would't want me to go further.  

Have a look at Chapter 5 of my PhD Thesis http://www.xesoftware.com.au/ThesisAsPassed.pdf

It is entitled Experiments in Classification and takes you through R and the various techniques.  True its in a rather different domain (speech recognition errors) but the problem is just the same: one of classification.

Stephen Choularton Ph.D., FIoD

9999 2226
0413 545 182


On 24/08/2011 7:00 PM, Gentil Homme wrote:
Thanks Stephen,


I'm currently first attempting to define one architecture (inputs to NN, which I believe need some preprocessing/denoising, ....)
I think that the process to train and test NN performance must be well organised, and the validation steps are much critical ...

I found also the neuralnet package that seems interesting for NN training.

I'll look after svms in a second step.

Which kind of data did you use in your nn tests ?


Best Rgds,

Pierre



2011/8/24 Stephen Choularton <[hidden email]>
I use nnet and it appears to work reasonably 'out of the box' as an algorithm but you get better performance if you play with the parameters to tune it.

svm appears to work best when you select Gaussian so I'm not sure about your assumption.

All these algorithms have similar R calls so its not to difficult to try lots of them out.  Try then out of the box first up.

good luck.

Stephen Choularton Ph.D., FIoD

9999 2226
0413 545 182


On 23/08/2011 4:51 PM, Gentil Homme wrote:
I didn't know about the theorem but it seems reasonable to believe that some techniques are more appropriate than others for modelling/predicting financial data.
It should be because of their nature : non gaussian, non linear, non stationary, ...

I think it's like the usual technical indicators (MACD, Stochastic, etc ... ) which are more or less suitable depending on the market conditions.

What would be your recommended R package for NNs, as there are different possible architecture : GRNN, PNN, SOM ... (see http://en.wikipedia.org/wiki/NeuroSolutions)

Before trying many solutions, maybe it's worth to have some discussion ... there can be another mighty theorem we should all know :-)

Best Rgds,

Pierre



2011/8/23 Stephen Choularton <[hidden email]>
I think that Gentil should be aware of the /No Free Lunch Theorem/ (Duda et al., 2001, Wolpert and Macready, 1997).  There are no context-independent or usage-independent reasons to favor one machine learning algorithm over another. If one performs better than another, it is owing to its better fit to the particular problem, not its general superiority.  If you wish to use these techniques try lots of them:  certainly neural networks and support vector machines, but also try some of the ensemble techniques such as bagging, boosting and random forest.  You can even try the statisticians favorite, logistic regression.  They are all available in R.

Stephen Choularton Ph.D., FIoD



On 23/08/2011 12:14 AM, Brian G. Peterson wrote:
On Mon, 2011-08-22 at 10:11 +0200, Gentil Homme wrote:
I just send out this post in order to share within r-sig-finance any
possible experience, advice, ... about NNs or SVMs with R.
It seems that you're asking us to share with you, and not sharing much
yourself in return.

Perhaps you could answer your own questions in this thread with the
things you are trying?

SVM's have been discussed on this list many times, please search the
list archives.

This blog has covered this topic:
http://www.aphysicistinwallstreet.com/

Also, there are a few books on machine learning that use R.

Several good records have been published in the litterature using these
techniques for financial trading strategies.
Which ones? References?

There are also commercial packages (expensive !) which seem to have achieved
good results.
Which packages?  References again?

Note that neural network strategies are very likely to create look-ahead
bias as you develop and test them.  You try something, fail, and try
again on the same data.  Unless you are very careful to reserve a 'pure'
set of instruments and dates that you won't *ever* touch until you think
you have a 'good' machine learning system, you're at pretty serious risk
of introducing your look-ahead knowledge into the system.  While this is
true to one degree or another in any quantitative strategy development,
I think it is a particular risk in self-adaptive machine learning
methodologies.


So I feel it could be nice to share within this group about the following
subjects :

- experience using the R packages
- data pre-processing before feeding the NNs (technical indicators,
wavelets, EMDs, ....)
- which type of NNs are suitable
- how to build and train them
- etc ...

Thanks to all for sharing within the R community
Now, your turn.  Bring the community up to date with your research so
far.

Regards,

   - Brian


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


No virus found in this message.
Checked by AVG - www.avg.com
Version: 10.0.1392 / Virus Database: 1520/3851 - Release Date: 08/22/11


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


No virus found in this message.
Checked by AVG - www.avg.com
Version: 10.0.1392 / Virus Database: 1520/3851 - Release Date: 08/22/11


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