Estimating Initial Delay Values for NARX System Outputs in Real-World Applications
12 views (last 30 days)
Show older comments
Hello MATLAB Community,
I am currently developing a NARX (Nonlinear Autoregressive Exogenous) system to estimate an output based on multiple inputs in a real-world control environment. While I was able to use the preparets function during the training and testing phases of my model, I now face a challenge.
In the real world, I won't have an actual initial output value to use as my initial delay values for the output. My goal is to predict these initial delays solely from the inputs. Here are my specific questions:
- What strategies can I employ to estimate the initial delay values for the output without an actual initial measurement?
- Any guidance on how to handle this scenario, including practical examples or resources, would be greatly appreciated.
Thank you in advance for your insights!
0 Comments
Answers (1)
William Rose
on 25 Oct 2024 at 20:39
To get an initial estimate for delay, I would compute the cross correlation of the input and the output. If you are fortunate, you will see a local peak at some reasonable number of lags (output lagging the input), and that number of lags can be your initial estimate. Of course if other parts of the system - the non-pure-delay parts - introduce their own lag, then the peak in the cross correlation will reflect the sum of the pure delay plus the lag due to other system dynamics. And therefore the lags to the peak in the cross correlation will be an overestimate of the pure delay. But it's only an initial esitmate, so maybe that will be good enough to get started.
Good luck.
1 Comment
William Rose
on 26 Oct 2024 at 3:37
You requested an example, so here is a simple example.
Make simulated data:
N=100; % signal duration (samples)
x=randn(1,N); % input
d=5; % delay (samples)
y=0.5*circshift(x,d)+0.5*randn(1,N); % output
Compute cross correlation:
[cxy,lags]=xcorr(x,y); % cross correlation
Plot results:
figure
subplot(211), plot(1:N,x,'-b.',1:N,y,'-r.');
grid on; legend('In','Out'); xlabel('Time (samples)');
subplot(212), plot(lags,cxy,'-g.')
xlabel('Lags'); grid on
The peak in the cross correlation at -5 lags means that y lags x by 5 samples.
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!