Testing NARX on data without known target
9 次查看(过去 30 天)
显示 更早的评论
I have a time series NARX neural network that is already trained on an external input, x(t), as well as the output's value at certain timesteps before (d past values of y(t)). Now I would like to take the trained network, input a new external input x(t), and get a time series prediction output. To prepare the inputs for getting the outputs I would need to use preparets to get the correct form of x(t), inputStates and layerStates, but it seems from the documentation that a target series is required for this. Since this is a test, I don't have a target series, what should I do? (I have no clue what the output y(t) would be (since this is a test).)
Thanks,
Mohsen
1 个评论
ben howey
2018-8-27
Hi,
Did you get an answer to this? I am currently trying to do the same thing. I have six degree of freedom motion data and associated pressure time series for each tilmestep. I have a NARX model that appears to predict the pressure very well. I now want to predict the pressure for other motion time series that I do not have the pressure data for.
What is the point of a NARX model if it can only predict data when a target is given? Surely you already know the output in this case so its not very useful?
...Very confused.
Any help in laymans terms would be great!
Thanks
回答(2 个)
Georgios Etsias
2020-5-3
Hello,
I know it has been four years since this question was done, and 2 years since the last comment. Nevertheless, I think it is worth answering this. You can indeed make a prediction for a new data set without having any target outputs.
One of the characteristic elements of NARX are the input delays. In order to get a good prediction in a new test set you just need a number of output targets equal to the input delays of your network (1 or 2 might be enough in most cases). If you do not have any target outputs (T) at all, you can put a random cell array including only 'zeros' or 'ones' (or some initial values that seem good enough). The initial predictions of the time series will probably not be good, but sooner or later the impact of the 'bad' initial values will diminish and the NARX will start giving good results again.
In the next figure a trained closed loop NARX was used to predict a new testing time series (2900 sec) that its target outputs were known to me. In the first instance (blue line) instead of the available target outputs I used some random values (ones). I the next case (orange) I used the correct output values for the first two seconds and then, used the same random values as before. The orange line predicted the results really good, while the blue and orange line converge after approx. 1000 sec. So your best shot is to utilize a few initial target values that are logical enough and let NARX do the rest.
I hope this helps.
All best
Georgios
PS When using the typical commands to make a predicytion with a closed loop NARX, T is your target goals:
net = closeloop(net);
view(net)
[Xs,Xi,Ai] = preparets(net,X,{},T);
y = net(Xs,Xi,Ai);
2 个评论
salma ben ftima
2021-5-12
Hi, thank you for this solution, but i want to ask you if it is necessary to test the narx in closedloop or we can do it also in open loop(since i have the same issue i created a narx trained in openloop and i want to test it with new external inputs with unkown targets)
Georgios Etsias
2023-4-9
编辑:Georgios Etsias
2023-4-9
You can find the source code for this example in my GitHub repo:
Greg Heath
2016-4-26
You cannot test a net without knowing the target.
Hope this helps.
Thank you for formally accepting my answer
Greg
2 个评论
Greg Heath
2016-4-26
RATS!!!, I wrote a long refute to your argument and lost it by hitting a wrong key. In short (Sorry for the brevity)
1. The input is not new, it is the same one used for design.
2. The new CL situation is that
[ x(1:2) t(1:2) x(3:end) y1(3:end)]
is replaced by
[ x(1:2) [0,0] x(3:end) y2(3:end)]
However, the default normalization yields
-1 <= yn(1:2) < 1
with an expected value of yn(1:2)close to [0,0].
So, no biggie.
3. However, your situation replaces x with xnew. That is an entirely different situation and not expected to be fruitful unless xnew is something like x.
Hope this was clear
Greg
另请参阅
类别
在 Help Center 和 File 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!