[R-sig-finance] bayesian signal classifier

Krishna Kumar kriskumar at earthlink.net
Mon Nov 28 02:21:14 CET 2005

Assume you have two decisions to make buy or sell. Then if you assume 
the classifications errors have the same cost (this  can be
modified suitably for cost) then a naive bayes classifier that minimizes 
the error rate is simply

prior * likelihood

So assuming that you have a prior computed in-sample from the timeseries 
you compute for each date the posterior decision buy or sell based
on the returns+ the signals (i.e. the feature vector).

Date            Returns        signal 1           signal 2            ...
02/01/1990  return2       buy               sell         ..........
03/01/1990  return3       buy               buy         ..............   

I am sure there are folks on this list who can throw more light on this 
R has a lot of classification related machinery that can be put to use
that will do better than this Bayes classifier. You may want to refer to 
these two books.


And finally the V&R yellow book describes some of the classifiers that 
are available in MASS.


paul sorenson wrote:

>The issue I am curious about is how to classify various signals (eg 
>price, volume, MACD, etc) into to buy, sell, or hold?
>Assuming I could "tokenize" various attributes of signals (value, 1st, 
>2nd and 3rd derivatives, crossing, etc), would it be feasible to take 
>these as inputs to a (trained) classifier which then outputs some number 
>between 0 and 1 representing buy, hold, sell?  The analogy I am thinking 
>of is a Bayesian spam classifier.
>My background is in engineering and I have only basic statistics 
>knowledge.  I have been using R for a couple of years now mostly for 
>graphic output.  I have a reasonable grasp of the language but I'm not 
>strong on the underlying theory of the statistical functions.
>R has a number of packages which deal with Bayesian statistics but I 
>don't have the knowledge to join the dots from there to a classifier.
>Any pointers would be most welcome.
>R-sig-finance at stat.math.ethz.ch mailing list

More information about the R-sig-finance mailing list