I have a time series data in Excel which follow autoregressive process. I need a Matlab code to calculate optimum lag length or in a simpler way to find the order of the process. Minimum of Akaike Information Criterion, Hannan–Quinn information criterion and Baysian Information should be used.