# Autoregressive Exogenous model on multiple datasets in MATLAB

I had trouble translating this exact question into search queries, which is why I am turning to you. Any sources you can provide on the topic would be greatly appreciated.

Say your data contains measurements for one output variable versus time and that experiment is repeated for different functions of an input variable. The specific case I am talking about is chicken's weight varying in time as a result of an input function (feed). The feed input function is a square wave of constant amplitude and frequency. Between different experiments, only the amplitude of the square wave changes (the daily amount of feed they get).

How could I build a model that can take a square wave input of feed of any amplitude and give a correct weight(t) response prediction? System can be considered time invariant for simplification.

I am currently using an Autoregressive (exogenous) approach in MATLAB: I analyze the data (input function of feed versus time, and a measured output of weight versus time). The exact approach is using rivid from the captain toolbox: this tool allows me to vary the number of coefficients in the model and compare each model according to certain criteria (YIC, AIC, ...). The result is a transfer function which I can use to make predictions for bird weight in time.

$$x(n)=\sum_{i=1}^Na_ix(n-i)+e(n)$$

However, I am modeling each feed amount input separately from the other ones. The models I am getting for each amplitude of feeding vary wildly, even having different numbers of coefficients. How can I take into account the data from all chicken feed experiments? My end goal is one model that can take any square wave input and will make a prediction for the chick's weight.

As a side question: the experiment is repeated a few times. Can I somehow have my model take into account all experiment iterations?