Could anyone provide me the details of how to determine the lag order of the distributed lags for an ADL(p,q) model in Matlab or another statistical package (and very much preferably in combination with the autoregression lags)?? Full working examples with model selection criteria (AIC and BIC) seem to be available on the Matlab website for VAR models, ARMA models etc. but I can't find one for the ADL(p,q) model. I would not have a clue to rewrite those models to ADL(p,q) myself but I have a vague feeling that such a thing would be possibe.
In the end I want to automate this analysis by first checking the lag orders p,q and then using this numbers automatically to create the regressions out of this. So basically I'm looking for a fully working example. (I want to skip part of adding and deleting regressors by hand as much as possible to get a quick idea of the distributed lags of several assets).