lundi 18 juillet 2016

How to run a script in python on multiple time series?

I am trying to run the following script :

cadf = ts.adfuller(df1.spread)
print 'Augmented Dickey Fuller test statistic =',cadf[0]
print 'Augmented Dickey Fuller p-value =',cadf[1]
print 'Augmented Dickey Fuller 1%, 5% and 10% test statistics =',cadf[4]

on my Data frame , my data-frame currently comprises of multiple time series (200+) , and I would like to run the above script on every time series . Below is an example of the dataframe :

Sn.No   A-B      B-C         A-C
  1       10       11.15       13.22
  2       11       12.36       14.75
  3       10.75    11.54       14.21

So , I would like to run the ADF test script on A-B,B-C and A-C and get the test statistic/output for each of them .

Aucun commentaire:

Enregistrer un commentaire