a u tocorrelation and partial a u tocorrelation
play

A u tocorrelation and Partial a u tocorrelation VISU AL IZIN G - PowerPoint PPT Presentation

A u tocorrelation and Partial a u tocorrelation VISU AL IZIN G TIME SE R IE S DATA IN P YTH ON Thomas Vincent Head of Data Science , Ge y Images A u tocorrelation in time series data A u tocorrelation is meas u red as the correlation bet w


  1. A u tocorrelation and Partial a u tocorrelation VISU AL IZIN G TIME SE R IE S DATA IN P YTH ON Thomas Vincent Head of Data Science , Ge � y Images

  2. A u tocorrelation in time series data A u tocorrelation is meas u red as the correlation bet w een a time series and a dela y ed cop y of itself For e x ample , an a u tocorrelation of order 3 ret u rns the correlation bet w een a time series at points ( t_1 , t_2 , t_3 , ...) and its o w n v al u es lagged b y 3 time points , i . e . ( t_4 , t_5 , t_6 , ...) It is u sed to � nd repetiti v e pa � erns or periodic signal in time series VISUALIZING TIME SERIES DATA IN PYTHON

  3. Statsmodels statsmodels is a P y thon mod u le that pro v ides classes and f u nctions for the estimation of man y di � erent statistical models , as w ell as for cond u cting statistical tests , and statistical data e x ploration . VISUALIZING TIME SERIES DATA IN PYTHON

  4. Plotting a u tocorrelations import matplotlib.pyplot as plt from statsmodels.graphics import tsaplots fig = tsaplots.plot_acf(co2_levels['co2'], lags=40) plt.show() VISUALIZING TIME SERIES DATA IN PYTHON

  5. Interpreting a u tocorrelation plots VISUALIZING TIME SERIES DATA IN PYTHON

  6. Partial a u tocorrelation in time series data Contrar y to a u tocorrelation , partial a u tocorrelation remo v es the e � ect of pre v io u s time points For e x ample , a partial a u tocorrelation f u nction of order 3 ret u rns the correlation bet w een o u r time series ( t1 , t2 , t3 , ...) and lagged v al u es of itself b y 3 time points ( t4 , t5 , t6 , ...), b u t onl y a � er remo v ing all e � ects a � rib u table to lags 1 and 2 VISUALIZING TIME SERIES DATA IN PYTHON

  7. Plotting partial a u tocorrelations import matplotlib.pyplot as plt from statsmodels.graphics import tsaplots fig = tsaplots.plot_pacf(co2_levels['co2'], lags=40) plt.show() VISUALIZING TIME SERIES DATA IN PYTHON

  8. Interpreting partial a u tocorrelations plot VISUALIZING TIME SERIES DATA IN PYTHON

  9. Let ' s practice ! VISU AL IZIN G TIME SE R IE S DATA IN P YTH ON

  10. Seasonalit y, trend and noise in time series data VISU AL IZIN G TIME SE R IE S DATA IN P YTH ON Thomas Vincent Head of Data Science , Ge � y Images

  11. Properties of time series VISUALIZING TIME SERIES DATA IN PYTHON

  12. The properties of time series Seasonalit y: does the data displa y a clear periodic pa � ern ? Trend : does the data follo w a consistent u p w ards or do w n w ards slope ? Noise : are there an y o u tlier points or missing v al u es that are not consistent w ith the rest of the data ? VISUALIZING TIME SERIES DATA IN PYTHON

  13. Time series decomposition import statsmodels.api as sm import matplotlib.pyplot as plt from pylab import rcParams rcParams['figure.figsize'] = 11, 9 decomposition = sm.tsa.seasonal_decompose( co2_levels['co2']) fig = decomposition.plot() plt.show() VISUALIZING TIME SERIES DATA IN PYTHON

  14. A plot of time series decomposition on the CO 2 data VISUALIZING TIME SERIES DATA IN PYTHON

  15. E x tracting components from time series decomposition print(dir(decomposition)) ['__class__', '__delattr__', '__dict__', ... 'plot', 'resid', 'seasonal', 'trend'] print(decomposition.seasonal) datestamp 1958-03-29 1.028042 1958-04-05 1.235242 1958-04-12 1.412344 1958-04-19 1.701186 VISUALIZING TIME SERIES DATA IN PYTHON

  16. Seasonalit y component in time series decomp_seasonal = decomposition.seasonal ax = decomp_seasonal.plot(figsize=(14, 2)) ax.set_xlabel('Date') ax.set_ylabel('Seasonality of time series') ax.set_title('Seasonal values of the time series') plt.show() VISUALIZING TIME SERIES DATA IN PYTHON

  17. Seasonalit y component in time series VISUALIZING TIME SERIES DATA IN PYTHON

  18. Trend component in time series decomp_trend = decomposition.trend ax = decomp_trend.plot(figsize=(14, 2)) ax.set_xlabel('Date') ax.set_ylabel('Trend of time series') ax.set_title('Trend values of the time series') plt.show() VISUALIZING TIME SERIES DATA IN PYTHON

  19. Trend component in time series VISUALIZING TIME SERIES DATA IN PYTHON

  20. Noise component in time series decomp_resid = decomp.resid ax = decomp_resid.plot(figsize=(14, 2)) ax.set_xlabel('Date') ax.set_ylabel('Residual of time series') ax.set_title('Residual values of the time series') plt.show() VISUALIZING TIME SERIES DATA IN PYTHON

  21. Noise component in time series VISUALIZING TIME SERIES DATA IN PYTHON

  22. Let ' s practice ! VISU AL IZIN G TIME SE R IE S DATA IN P YTH ON

  23. A re v ie w on w hat y o u ha v e learned so far VISU AL IZIN G TIME SE R IE S DATA IN P YTH ON Thomas Vincent Head of Data Science , Ge � y Images

  24. So far ... Vis u ali z e aggregates of time series data E x tract statistical s u mmaries A u tocorrelation and Partial a u tocorrelation Time series decomposition VISUALIZING TIME SERIES DATA IN PYTHON

  25. The airline dataset VISUALIZING TIME SERIES DATA IN PYTHON

  26. Let ' s anal yz e this data ! VISU AL IZIN G TIME SE R IE S DATA IN P YTH ON

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend