Using NN for forcasting

Hi all,
I would like to design Feed forward NN for stock price forecasting. I've 3 years stock price datas which are consist of 2010,2011 and 2012.
I'm going to use 2010 and 2011 as training data and 2012 as forecasting.
This is an example input.
% code
date price
3-Jan-10 1271.87
4-Jan-10 1270.2
5-Jan-10 1276.56
6-Jan-10 1273.85
....
26-Dec-12 1419.83
27-Dec-12 1418.1
28-Dec-12 1402.43
31-Dec-12 1426.19
So how can I classify input, target and test data to NN ?

 채택된 답변

Shashank Prasanna
Shashank Prasanna 2013년 1월 15일

0 개 추천

What you are looking at is timeseries modeling and not a classification network. In order to forecast a time series such as your stock data you will need an autoregressive network which will capture the trend in the stock data.
Since you have a single time series with which you want to train a network and then forecast for future, a NARX network should work best for you. I would start by pointing you to this example in the MATLAB documentation that does exactly that. The GUI should guide you through it and generate code for future use or manipulation:
When you run ntstool, choose the NAR network since you don't have an external influence (such as another stock etc).

댓글 수: 6

a
a 2013년 1월 15일
I have tried to use NARX with nnstart.
I'm still confuse to classify the input. I'm going to use 2010 and 2011 as training data and 2012 as forecasting.
date price
3-Jan-10 1271.87
4-Jan-10 1270.2
5-Jan-10 1276.56
6-Jan-10 1273.85
....
26-Dec-12 1419.83
27-Dec-12 1418.1
28-Dec-12 1402.43
31-Dec-12 1426.19
So what is my input, target and test data look like?
Shashank Prasanna
Shashank Prasanna 2013년 1월 15일
If you choose NAR network, there are no inputs! there isn't even an option for you to provide one, did you try to run "ntstool" in matlab and choose NAR network?
provide your 2010 and 2011 data combined in one big vector, without the time data, just the price data only. You can choose any percentage of data for testing and validation. I would leave the default.
I urge you to run the ntstool and try it first, let me know if you have questions or if you are still unable to run it.
a
a 2013년 1월 16일
Thank you for you help, I got 1 step ahead forecasting with NAR network.
Then I need 5 step ahead forecasting, what should I do?
Greg Heath
Greg Heath 2013년 1월 16일
Change the 1 to 1:5
Greg
a
a 2013년 1월 16일
Where?
Shashank Prasanna
Shashank Prasanna 2013년 1월 16일
In the generated code you can use the closed loop network for multi-step prediction.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기

질문:

a
a
2013년 1월 15일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by