Why can future values affect NARX time series output?
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Kevin Johnson
el 11 de Feb. de 2023
Comentada: Kevin Johnson
el 11 de Feb. de 2023
I am using A NARX network with one target vector and several input vectors. I am trying to predict the target value each day based on the inputs provided that day. If I feed all of the input and target values into the network up to and including the current day, I get one output result. But if I also feed in additional future input and target values, I get a different output result.
I have used " rng 'default' " to keep the same seed for the random number generator. I suspect there is some normalization or something going on that is using the future values, but I can't locate it. I am not doing that myself.
Obviously, any prediction routine that uses future data is invalid.
Thoughts?
I checked this as follows: I substituted a linear regression model instead of the NARX, and got completely reproducible and identical results whether the future data was present or not. The inputs and targets fed to this routine were identical to those fed to the NARX.
0 comentarios
Respuesta aceptada
Walter Roberson
el 11 de Feb. de 2023
Movida: Walter Roberson
el 11 de Feb. de 2023
I am perhaps being naive on this, but the behaviour you describe for NARX is what I would expect.
Suppose you had a series of points and you were doing a polynomial fit on them and using it to estimate values:
rng(12346)
N = 25;
x = 1:25;
y = rand(1, N);
x20 = x(1:20);
y20 = y(1:20);
p20 = polyfit(x20, y20, 8);
yfit20 = polyval(p20, x20, y20);
plot(x, y, '.k');
hold on
plot(x20, yfit20, '-ob');
hold off
Now, would you expect the same prediction for the 20th location if you added more data in?
p_all = polyfit(x, y, 8);
yfit_all = polyval(p_all, x, y);
figure
plot(x, y, '.k');
hold on
plot(x20, yfit20, '-ob');
plot(x, yfit_all, ':+r');
hold off
Any system that uses any kind of aggregate information (mean, standard deviation, moments) is likely to produce a different output for a given location if you fed it more information.
7 comentarios
Walter Roberson
el 11 de Feb. de 2023
But if I also feed in additional future input and target values, I get a different output result.
Perhaps I am not understanding you in what you mean by that.
If you are saying that given rng('default') that you expect that if you feed in only x(1:20) and y(1:20) that the prediction for x(21) should be the same as-if you had feed in all x(1:25) and y(1:25) and then asked to predict for x(21) -- if that is what you are saying, then I would remind you that when you have more input data then the random splits between training and test and validation are going to be different, and different number of iterations might be used to meet tolerance goals (training can stop for a number of different reasons, not just for having taken a fixed number of iterations).
Más respuestas (0)
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!