Variable delays in NARX net

1 回表示 (過去 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 件)

カテゴリ

Help Center および File ExchangeSequence and Numeric Feature Data Workflows についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by