This example models the expenditure time series as a function of exogenous variables (income and investment) and the AR and MA parameters. The function chooses the order and lag of the variables according to the degree of complexity, typically a trade-off between accuracy and overfitting.