필터 지우기
필터 지우기

How alignment of data is treated by the neural network algorithms for one day ahead prediction

조회 수: 2 (최근 30일)
I am having trouble understanding how the alignment of data is treated by the neural network algorithms for one day ahead prediction.
Suppose we have a target T from times 1,2,3…t. Suppose we have inputs X from times 1,2,3,…t. Imagine each time step is one day.
We want to do one step ahead prediction for each day prospectively, day by day. This means we never want to use any future information. Also, we want to predict tomorrow’s target at the end of today. In other words, we want to use X(1:t) and T(1:t) to predict T(t+1); we do not have X(t+1) at our disposal for this purpose, because that information lies in the future.
If we create a narxnet network with X(1:t) and T(1:t) aligned in time, the default output is T(t) which is found using all of X, including X(t).
So instead we convert the network a step ahead network. At time t, this gives us T(t+1) using only data from days 1 through t.
Is this correct? The results I get seem too good to be true.
  댓글 수: 3
Kevin Johnson
Kevin Johnson 2018년 5월 12일
% inputsnn - input time series. % targetnn - feedback time series.
% note: inputs and target are aligned in time
X = tonndata(inputsnn,false,false); T = tonndata(targetnn,false,false);
% Training Function trainFcn = 'trainbr';
% Create a Nonlinear Autoregressive Network with External Input inputDelays = 1:2; feedbackDelays = 1:2; hiddenLayerSize = 10; netts = narxnet(inputDelays,feedbackDelays,hiddenLayerSize,'open',trainFcn);
% Prepare the Data for Training and Simulation [x,xi,ai,t] = preparets(netts,X,{},T);
% Setup Division of Data for Training, Validation, Testing netts.divideParam.trainRatio = 70/100; netts.divideParam.valRatio = 15/100; netts.divideParam.testRatio = 15/100;
% Train the Network [netts,tr] = train(netts,x,t,xi,ai);
% Test the Network y = netts(x,xi,ai); e = gsubtract(t,y);
% Step-Ahead Prediction Network netsa = removedelay(netts); netsa.name = [netts.name ' - Predict One Step Ahead']; [xs,xis,ais,ts] = preparets(netsa,X,{},T); ys = netsa(xs,xis,ais); resultnn=[NaN;cell2mat(ys)'];

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

답변 (1개)

Greg Heath
Greg Heath 2018년 5월 14일
편집: Greg Heath 2018년 5월 14일
I don't understand your problem.
What fraction of the target variance did you want to achieve?
mse(error)/mean(var(target',1)) <= ?
Greg

카테고리

Help CenterFile Exchange에서 Sequence 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