Input-Output Fitting problem with a Neural Network - Stock predication
显示 更早的评论
Hi, I'm trying to predict stock values(in this case, the closing value). In the end I want to achieve the same result as this example, Example
I will use the "close price" and its corresponding date, but I cannot figure out how to use "input" and "target" and what they mean.
% This script assumes these variables are defined:
x = simplefitInput; //
t = simplefitTargets;
% Create a Fitting Network
hiddenLayerSize = 10;
net = fitnet(hiddenLayerSize,trainFcn);
% setup Division of Data for Training, Validation, Testing
net.divideParam.trainRatio = 70/100;
net.divideParam.valRatio = 15/100;
net.divideParam.testRatio = 15/100;
% Train the Network
[net,tr] = train(net,x);
% Test the Network
y = net(x);
e = gsubtract(t,y);
performance = perform(net,t,y)
% View the Network
%view(net)
If understand it correctly, x is the input of the system. But what is t ? So Im wondering: What kind of values do I give to x and t ?
采纳的回答
更多回答(1 个)
Greg Heath
2014-6-5
编辑:Greg Heath
2014-6-5
My previous answer is for regression and curve-fitting.
Unfortunately, I concentrated more on your given code than your written description.
You have a time-series problem and should be using the time-series function NARXNET; not the regression/fitting function FITNET.
help narxnet
doc narxnet
For MATLAB time-series example data
help nndatasets
doc nndatasets
I have posted tens of examples. Search the NEWSGROUP and ANSWERS using
greg narxnet
and
greg narxnet nncorr
For your case the output target is probably close or adjusted close. The inputs are the other tabulations. Try searching for
narxnet stock
narxnet forecasting
Hope this helps.
Thank you for formally accepting my answer
Greg
类别
在 帮助中心 和 File Exchange 中查找有关 Deep Learning Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!