Clear Filters
Clear Filters

Which regressors do the parameter estimates belong to returned by 'nlarx'?

20 views (last 30 days)
I estimate a model using 'nlarx' from data like this
mdl = nlarx(data,sys);
Then, in the 'mdl' object has a field
mdl.Report.Parameters.ParVector
which lists the parameter estimates in a single column vector. Now, i see that the number of parameters estimates equal the number of 'true's in
sys.RegressorUsage
which is a table, however, I do not find information anywhere, in the Matlab documentation or on the internet, which individual instant of 'true' in sys.RegressorUsage, i.e., which individual regressors, belongs to which entry of mdl.Report.Parameters.ParVector.
Furthermore, i would like to ask where i can find p-values or standard errors for each of these parameter estimates.
Any help would be much appreciated!
  3 Comments
Tamas
Tamas on 19 Jul 2024 at 9:12
Edited: Tamas on 19 Jul 2024 at 9:20
Hi Umar,
Many thanks for the quick response!
As for the first question, i think i understand your answer. Sorry about being tedious about it, but would you be kind to confirm if this is what you meant? Say, we 1. define the model 2. estimate parameters and 3. extract the parameter estimates like this:
sys = idnlarx(output_name,input_name,orders);
mdl = nlarx(data,sys);
par_est = mdl.Report.Parameters.ParVector;
These are the regressors
myregs = getreg(sys);
that we potentially use in each of the
neqs = length(output_name);
number of (potentially coupled) equations that the system consists of. That is, we have a number
nterms = length(myregs)*neqs;
of terms in the whole system. But we want to knock out some of those terms, which we can do by setting entries of the
regus = sys.RegressorUsage;
table 'false'. This table corresponds to the 2D matrix
ru_mat = table2array(regus);
whose entries we can keep count of by the "column-wise" "linear" indices of it:
myregs_linind = (1:nterms)';
These linear indices of the matrix would correspond to "ordinary" indices of the vector coming from the "colonisation" of the matrix:
ru_vec = ru_mat(:);
Finally, is it correct that the subselected terms (regressor & equation/output variable)
whichregneq = myregs_linind(ru_vec);
correspond entry for entry with par_est?
As for the second question about uncertainty quantification. Sorry, i know 'fitlm' would return those things. But i need 'nlarx' to do that. Do i miss a point of yours?
If not, is it possible that "inside" 'nlarx' those p-values/SEs are calculated but not provided as an output for the user?
Umar
Umar on 19 Jul 2024 at 16:15
Hi Tamas,
Regarding your first query,” correspond entry for entry with par_est?”, the alignment of subselected terms with parameter estimates is correctly established. The 'true' entries in sys.RegressorUsage correspond to parameter estimates in mdl.Report.Parameters.ParVector. By setting entries in the sys.RegressorUsage table to 'false', specific terms can be excluded. The linear indices derived from sys.RegressorUsage matrix help in selecting the desired terms. The whichregneq vector, obtained from these indices, indeed corresponds entry for entry with par_est, ensuring the correct association between regressors, equations, and parameter estimates.
Addressing your last query, “ about uncertainty quantification. Sorry, i know 'fitlm' would return those things. But i need 'nlarx' to do that. Do i miss a point of yours?If not, is it possible that "inside" 'nlarx' those p-values/SEs are calculated but not provided as an output for the user?”
Sorry, if I missed details in my earlier post, 'nlarx' focuses on system identification rather than statistical inference. While 'nlarx' does not directly output p-values or SEs, you can still assess model uncertainty through techniques like bootstrapping or Monte Carlo simulations to derive confidence intervals for model parameters if this s what you are trying to accomplish. Also, you can still consider using 'fitlm' or other statistical tools alongside 'nlarx' for a comprehensive analysis.

Sign in to comment.

Answers (0)

Categories

Find more on Linear Model Identification 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!