The statement "order of the polynomial B(q) + 1" in the documentation is somewhat ambiguous

The following statement appears in a number of places in the documentation and refers to the nb parameter of discrete linear systems represented by polynomials, such as ARX, ARMAX, BJ, etc.:
"nb is the order of the polynomial B(q) + 1"
where B(q) is defined as follows for the ARX model for example:
A(q) y(t) = B(q) u(t-nk) + e(t)
However, I find this statement ambiguous. Does it mean "(the order of the polynomial B(q)) + 1", in other words nb = n + 1 where n is the order of B(q)? Or is nb the order of the polynomial (B(q) + 1), i.e. the terms of B(q) + the zeroth-order term 1? (The latter seems unlikely since adding a zeroth-order term should not change the order, if it is defined as the power of the highest term).
To confirm, in the following example, I set na=2, nb=2, nk=2:
>> sys = arx([y u], [2 2 2])
sys =
Discrete-time ARX model: A(z)y(t) = B(z)u(t) + e(t)
A(z) = 1 - 1.1 z^-1 + 0.321 z^-2
B(z) = 1.222 z^-2 + 0.8787 z^-3
Sample time: 1 seconds
Parameterization:
Polynomial orders: na=2 nb=2 nk=2
Number of free coefficients: 4
Use "polydata", "getpvec", "getcov" for parameters and their uncertainties.
Status:
Estimated using ARX on time domain data.
Fit to estimation data: 72.29% (prediction focus)
FPE: 1.692, MSE: 0.9112
Here, B(z) is a third order polynomial but it includes the delay of nk=2 timesteps (u(t-nk) = z^-2 u(t)) so does that mean B(q) is 1st order in this example, therefore nb = 1 + 1 = 2?
Incidentally, the definition of nb in the documentation for OE models is written in a slightly less ambiguous way:
  • "nb — Order of the B(q) polynomial + 1"
But in the code documentation for arx (help arx) it says the following. Here there is no mention of "+1":
ORDERS = [na nb nk], the orders of A and B polynomials in the arx model.

7 Comments

Hi Bill,
I read the doc page arx, left, and came back to it and the words still don't make sense. Not to mention the mixed notation with discrete- and continuous-time, i.e., A(z)*y(t) (maybe that's standard in the System ID world). This section of the doc page is not helpful.
Things are further confusing because the screen output of B(z) as shown above is NOT the same as B(z) (or B(q)) as shown in the ARX structure definition of the model. For your example, the B(z) in the math model is really first order
B(z) = 1.222 + 0.8787 z^-1
and then the b parameter of sys, i.e., sys.b, should be the standard Matlab representation of B(z^-1)*z^(-nk) in ascending powers of z^-1.
sys.b = [0 0 1.222 0.8787]
Based on your example and a few that I tried, it seems that na and nb are really supposed to be the number of unknown coefficients in A(z) and B(z) (as defined for the model) respectively. Keeping in mind that A(z) is assumed to always have a leading coefficient of 1, at least based on my reading of the doc, then na is the same as the order of A(z). But that's not the case for nb. Maybe they really mean nb = order(B(z)) + 1, which you identified above as a possbility (keeping in mind that B(z) here is not the same as the B(z) in the screen output. But if that's what is meant, the doc is doing a really poor job of explaining that, and phrases like "Because sys.b + 1 is a ..." make no sense whatsoever.
And I don't understand what the Name-Value parameter InputDelay is. Is that supposed to be a delay on the input disturbance, e? I assume that is the case because any delays on the input u would be captured by nk, but the doc does not explictily say to which input (u or e) InputDelay is applied.
I agree that relating na, nb, etc to the number of unknown coefficients in the polynomials seems like a good way to go. I went back to my university course notes, and rather than try to describe what na, nb etc are in words, they simply lay out the polynomials showing all the parameters and how na, nb, define their number as follows:
Source: My notes from taking the course GEL-7017 System Identification, Laval University, in 2021.
Is this consistent with the definitions in Matlab? Maybe the polynomials are defined in this way in the Matlab documentation somewhere but I couldn't find it. In any case, to me this is clearer.
At the end of every documentation page (at least every one that I’ve encountered), there is a star rating option just under:
How useful was this information?
You can use that to rate the page. It will then ask you why you gave it that rating, and you can comment on it there. I understand that will reach the people who wrote the documentation.
For comparision, here's the system definition in the documentation for the polyest function:
This does clearly show the effect of nk (on the deterministic input).
@Star Strider. Good point. I left a rating and a comment and a link to this discussion on the polyest documentation page.
The link in my comment above to the "defintiton of the model" for the arx function shows the structure of the ARX model (and others) where you'll also see the effect of nk on the deterministic input.
I hope you provided feedback on this page: arx.

Sign in to comment.

Answers (0)

Products

Release

R2021b

Asked:

on 13 Nov 2023

Commented:

on 13 Nov 2023

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!