Variable delays in NARX net

조회 수: 2 (최근 30일)
mathbourne
mathbourne 2016년 7월 15일
댓글: Greg Heath 2016년 7월 16일
Using the Neural Network Toolbox, I would like to forecast the hourly sales from a shop for a year. The shop itself only gives the sales data 18 hours after it happened.
Another shop of the same type also gives the data 18 hours after it happened but in the meantime, they give a forecast. Since the sales between the two are correlated, I wanna use the sales from the other shop as an external input in a NARXNET.
To train my net, I have the choice of using the real sales of the other shop; b_sales, or the forecast; b_sales_forecast.
What I would really like to do however is use all the information.
At each timestep, I would like to have a compound of the 2 variables; input delays from 0 to 18 would be b_sales_forecast and from 19 to 48 would be b_sales.
I thought I would find a way to do this within the 'tonndata' or the 'preparets' function but I found nothing.
This is my code :
dataset = [dummyvar(date_string.Month) dummyvar(date_string.Hour+1) b_sales_forecast];
X = tonndata(dataset,false,false);
T = tonndata(a_sales,false,false);
trainFcn = 'trainlm';
inputDelays = 0:48;
feedbackDelays = 18:48;
hiddenLayerSize = 25;
net1 = narxnet(inputDelays,feedbackDelays,hiddenLayerSize,'open',trainFcn);
[x,xi,ai,t] = preparets(net1,X,{},T);
net1.divideParam.trainRatio = 70/100;
net1.divideParam.valRatio = 15/100;
net1.divideParam.testRatio = 15/100;
[net1,tr] = train(net1,x,t,xi,ai);
y = net1(x,xi,ai);
output=cell2mat(y)';
Thank you for your time.
  댓글 수: 1
Greg Heath
Greg Heath 2016년 7월 16일
Insufficient information and explanation.

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

답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by