Using built in ARX function to estimate a linear ARX model for multiple input/output pairs of different size

31 views (last 30 days)
Hello,
I have multiple trials of input / output (aka I/O from now on) data for a system sampled at 1 millisecond resolution. Each trial lasts a couple of seconds. In total there are, lets say, hours of data. Thousands of trials were performed.
being an ARX model, the response of the system to an input at any given time is dependent both on past inputs, and previous responses of the system. This being the case, the first few elements of each trial cannot be modelled (assumingly the purpose of the time delay argument of ARX function?), as they do not come with previous data for which to estimate a system response.
Alright great, here is where the problem comes up. Because of this need to skip the initial elements of each trial, I cannot just concatenate all the I/O data across trials into some mega vector and feed that into the arx function as one I/O pair - some of those elements will actually be independent of the previous data which arx will base the estimated model on.
And, I can't take advantage of the multi I/O pair functionality of the arx function because the trial durations were variable. As such, the length of the I/O pairs are different from trial to trial. So they cannot all be expressed in an array where each row represents new trial data, because that will cause each row to need to have a different size.
Anyone familiar with the arx function and have an idea for how to approach this problem correctly? I was thinking I could just fill the empty spots with NaN's.. but I don't know too much about the flexibility of arx.
Thanks in advance.

Accepted Answer

Rajiv Singh
Rajiv Singh on 5 Jun 2012
Try creating independent iddata objects for each I/O pair. Then merge them into one "multi-experiment" iddata object. Use the multiexperiment data object for estimation.
z1 = iddata(output1, input1, Ts)
z2 = iddata(output2, input2, Ts)
...
zMerged = merge(z1, z2, ...)
model = arx(zMerged, [na nb nk])
I assume all recordings of I/O data come from the same physical experiment, so that the delays are consistent among them. You don;t have to skip any data portion explicitly, just set the "nk" value appropriately.
  2 Comments
Ayman
Ayman on 5 Jun 2012
Thanks a lot. That seems like it should work nicely - you also cleared up a misconception I had about the nk parameter.
Rajiv Singh
Rajiv Singh on 5 Jun 2012
Well, nk is represents input to output delay. If you suspect that the output observations lag by a few samples, set nk to those number of lags. Since in physical systems output is rarely influenced instantaneously by the input, nk is typically >=1.
The first few samples of observed data set up the *initial conditions* for estimation (separately for each data experiment, even after your merge them). So do not skip anything, but be aware that first N samples will be used for setting up the problem, where N = model order = max(na, nb)

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!