I am triying to fit a NLARX model using MATLAB 2024a but for some reason the fit is poor, but I have used the same code with MATLAB 2023b and the fit is good.
5 views (last 30 days)
Show older comments
I am using the LM estimation method and the estimation dataset is the same. The only difference is that for the MATLAB 2024 the fitting is very bad, but for MATLAB 2023b it is okay. It is very strange. I have test also the same code in differnet computers and the behavior is the same. The erros seems to happen in the 2024a version of the nlarx function.
What can I do ?
Answers (1)
Animesh
on 29 Aug 2024
In MATLAB R2024a release, the linear model specified in the Nonlinear ARX model is preserved as-is during the model coefficient initialization stage. In contrast, previous releases modified the specified linear model beforehand to minimize the 1-step prediction errors.
In this situation, the provided linear model does not offer a good initial guess for the linear component of the Nonlinear ARX model. It worked in previous releases because the linear model was adjusted beforehand. Allowing the algorithm to select a better linear model can improve its quality.
Here’s something you can try:
Instead of using the linear model ("linsys_d"), use an ARX-order matrix that matches its order:
na = eye(2) * 4;
nb = ones(2, 10) * 4;
nk = ones(2, 10);
Order = [na nb nk];
Net = nlarx(data.tData, Order, NonlinearFcn, nlarxopt);
This approach gives the NLARX algorithm full freedom to choose the coefficients of the linear component (`Net.OutputFcn(i).LinearFcn` for `i=1,2`).
This is also how the MATLAB R2023a version operates. The specified linear model is not retained as the starting point for simulation-error minimization; instead, it is modified beforehand to provide the optimizer with a good starting point.
Hope this resolves your query.
0 Comments
See Also
Categories
Find more on Nonlinear ARX Models in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!