Multiple exogenous variables under arima

1,822 views
Skip to first unread message

Philip Worrall

unread,
May 21, 2015, 11:21:14 AM5/21/15
to pystat...@googlegroups.com
Hello,


I'm analysing a time series using the statsmodels package and specifically the arima class. Just wondered if it is currently possible to specify more than one exogenous variable (for example oil price and temperature)  statsmodels.tsa.arima_model.ARIMA(endog, order, exog=None, dates=None, freq=None, missing='none'). I have tried passing a list of list of values but i receive an error about matrices being different sizes. If i pass a single list it works as expected.



Thanks Phil

josef...@gmail.com

unread,
May 21, 2015, 11:24:19 AM5/21/15
to pystatsmodels
a list of list has the wrong shape: when it gets converted to a numpy array with np.asarray then the observations will be in columns and variables in rows which is the transpose of what we need or use.

try 
exog = np.column_stack(list_of_lists)
to convert to a numpy array.

I hope that works.

Josef

 


Thanks Phil

Philip Worrall

unread,
May 21, 2015, 1:26:11 PM5/21/15
to pystat...@googlegroups.com
Thanks Joesf, worked perfectly
Reply all
Reply to author
Forward
0 new messages