Hi Nick,
You said 1 input. Are you using feedback loops ?
I would agree with a single layer - 2nd & subsequent layers usually make a trivial difference to the results and take an order of magnitude more to learn.There are proofs that a single hidden layer is sufficient. Try two, if you wish. Not three or more.
Hi Nick --
It is possible to use only one input data stream for a neural network. But there will probably be several derivatives created from it, so that input layer to the NN will have several input nodes.
For example, begin by using closing price as the input stream. Since all variables must be transformation invariant, price itself is not a good input. So create several derivative indicators that are transformation invariant. Try RSI(2), RSI(3), Z-Score(5), ROC(1), etc. There should be as many zero crossings per time period (say month) in each of the inputs to the NN as there are changes in state of the target variable per that same time period.
Since a neural network works best when the inputs are all in the range of 0 to 1, normalize everything using a sliding window. There will be, say 10, inputs to the NN. Each row of the input must be independent of all other rows. So, in order to compare values or use changes, the prior data or change must be included as its own variable. For example, RSI(2) today and RSI(2)ChangeFromYesterday. 10 inputs is not many, but look at what happens next.
There are proofs that a single hidden layer is sufficient. Try two, if you wish. Not three or more.
The number of terms in the equation represented by the NN is the product of all the nodes. With 10 inputs, 5 in each of two hidden layers, 1 output, there are 250 nodes. If the period of stationarity is determined to be one year, 252 trading days, the learning process will be fitting a 250 term equation to 252 data points. This is all in-sample and the fit will be really good. Test by predicting the next three months -- 60 trading days -- as an out-of-sample test. Expect results to really bad. (If they are good, double check everything -- you are probably fooling yourself and made a mistake somewhere.) If they are bad, either reduce the number of nodes or increase the number of data points. Reducing the number of nodes means the equation will be less complex -- fewer inputs and / or fewer hidden nodes. Deciding what to keep and what to give up is difficult and will require experimentation. Increasing the number of data points is good provided that relationships being learned are consistent throughout -- this is concept of stationarity. More data is bad when the additional data is different.
Keep us posted.
Best regards,
Howard
I would agree with a single layer - 2nd & subsequent layers usually make a trivial difference to the results and take an order of magnitude more to learn.
Visit the forums at kaggle.com for more ideas - IMO a small community of v. high quality people solving real world problems.
Also consider getting a (free) AWS account & running your python scripts there 24/7.
Yes. And the best pattern recognition system by far is the human brain. However, as demonstrated by some of the TA threads it can suffer from overfitting.But please let me know if I understand this correctly - neural networks is all about pattern recognition.
So you are essentially the brains behind the NN.You say that one can use only one variable and a few derivatives of that variable. Let's say I use Close and RSI(2), RSI(3), Z-Score(5), ROC(1). Since these variables are based on data of the last 5 days at most (let's make this assumption, even if it may not be correct) - does it mean that the pattern recognition is limited to data of the last 5 days? Does it mean that if I have a very smart ANN, I can supply just the close values of the last five days to its five inputs and, being so smart, it will remove the noise by itself, find the best data and create its own internal indicators and provide better results?
If this is the case, would this approach work? It is an alternative to ANN. I have 4 input variables. I normalize each of them to 0...1 interval and then I create a large matrix and I split this interval in 3 ranges - then, for every new data set, I store the following information - pattern[0..2][0..2][0..2][0..2], increment the number of appearances of this particular pattern, how many time the price increased following this pattern, how many times the price decreased. Then I choose only the patterns that appear most often and that have the largest bias between wins/losses. There is an obvious roughness of this method, compared to ANN, but the advantage would be that learning would be much faster.
As long as a piece of string... depends on how many layers, how many nodes, how much data, how much processing power, your stopping conditions. When developing a NN aim for minutes, so you can iterate to the next dud idea faster. When you've got something vaguely reasonable throw lots of data at it & let it train for a couple of days ?By the way, what is the expected learning time for a neural network like you described above? Is it minutes, hours, days, weeks?
Yes. And the best pattern recognition system by far is the human brain. However, as demonstrated by some of the TA threads it can suffer from overfitting.
Hi Nick --
Please re-read my posts #5 and #9 in this thread.
Forecasting the direction of price change one bar ahead (or something equivalent as a target for the learning) is a very difficult problem. The markets are nearly efficient, the signal to noise ratio is very low, the data is nonstationary, neural networks are prone to overfitting to the in-sample data, etc.
Become very familiar with modeling and simulation techniques. Begin with modeling stationary data (such as the Iris data), then progress to time series, then to financial time series. Each is more difficult than the previous. Whenever you are reading about or working with any technique, pay very close attention to how validation will be done.
The most value the modeler (that is you) can add is clever transformations of the raw input data to produce a highly predictive model. Expect to spend 80 percent of your time in this task.
Begin by reading a lot. The internet for starters.
Enroll in artificial intelligence / pattern recognition classes in Coursera or one of the other online educational programs. They are (mostly) free and university undergraduate and graduate level. If necessary, review the math needed -- mostly linear algebra, some statistics.
Learn to use one of the machine learning libraries that has a neural network component. I recommend the Python language with the Scikit-Learn library. Also free.
Keep in mind that the problem you are working on is modeling, simulating, and forecasting financial time series. Financial time series analysis is an order of magnitude more difficult than analysis of stationary data.
Expect to spend on the order of 5,000 to 10,000 hours in an attempt to develop a usable solution. Do not be too disappointed if you never find one that you have confidence in using for real money trading, even after all that time and effort.
Best,
Howard
Hi Nick --
Expect to spend on the order of 5,000 to 10,000 hours in an attempt to develop a usable solution. Do not be too disappointed if you never find one that you have confidence in using for real money trading, even after all that time and effort.
Best,
Howard
The iris dataset is just numeric 4 attributes for a sample of 150 iris flowers.By the way, the Iris you mention - is it a database of recognition of eye irises?
If that's the case, I read about some databases for character recognition, MNIST, the data in it would also be stationary? Any advantage in using Iris instead of MNIST (http://yann.lecun.com/exdb/mnist/)?
Where can I find details about Iris (apart for looking into a mirror)?
The iris dataset is just numeric 4 attributes for a sample of 150 iris flowers.
Hi Nick --
Keith is correct about the Iris dataset. It is one of datasets often used to demonstrate machine learning techniques.
https://archive.ics.uci.edu/ml/datasets/Iris
If you have not already, you might download and read the free chapters here:
http://www.quantitativetechnicalanalysis.com/book.html
Here are links to some of the many machine learning courses available free online:
https://www.coursera.org/course/ml
https://work.caltech.edu/telecourse.html
http://ocw.mit.edu/courses/electric...ence/6-034-artificial-intelligence-fall-2010/
Note that none of these courses go beyond analysis of stationary data. None discuss time series.
Read about the developments already made in applications of machine learning to trading (among many other fields):
http://www.amazon.com/Rise-Robots-T...1432569128&sr=8-1&keywords=rise+of+the+robots
Best regards,
Howard
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?