ARIMA-style feed analysis: for {BoxCox=T/F, diff=0,1,2}, plot the seasonality and ACF/PACF #1009
Closed
Description
Background / motivation
Parent epic: #1006 "Explore SARIMAX modeling"
Top-level goal: Help user answer which of which transform to use {0, B0, B1, B2}, to (a) achieve stationarity; and (b) see how well the signal can decompose into trend / seasonal / residual.
Specific transforms:
- 0: differencing = 0
- B0: Box-Cox transform + differencing=0
- B1: Box-Cox transform + differencing=1
- B2: Box-Cox transform + differencing=1
Sub-goals: We want it easy to see these:
- decomposition into trend / seasonal / residual
- relative strengths of trend vs seasonality vs resid
- ACF & PACF. That is, autocorrelation function & partial autocorrelation function, for insight into best AR coefficient etc
- ADF for each transform {0, B0, B1, B2}. Insight: the lowest # that has ADF < 0.05 is the best
- Then, make it easy for the user to select a transform and see the plots ^ for that given transform
Best ref: jahnvisikligar Master's thesis https://github.com/jahnvisikligar/Masters-Thesis/blob/main/Final_Thesis_code.ipynb
TODOs / DoD
- Add real crypto data, ready for use by unit tests PR #1016
- Unit test with plots for each sub-component:
Main prototype: with everything
For a given choice of differencing {0,B0,B1,B2}, show
- 5 decomposition plots: energy per signal, plus 4 signals: (i) observed feed (ii) "trend" (iii) "seasonal", "residual".
- autocorrelation (ACF) & partial autocorrelation (PACF) plots
Other Prototypes & Examples
Prototype: decomposition into trend / seasonality / residual
Prototype: For differencing=0,B0,B1,B2, show 5 decomposition plots
Prototype: For differencing=0,B0,B1,B2, show ACF & PACF
Example 0: neptune.ai "select model"
Ref: neptune.ai select-model post
from statsmodels.tsa.seasonal import seasonal_decompose
result = seasonal_decompose(co2_data)
result.plot()
Example 1a: Sikligar thesis, Differencing=0
Example 1b: Sikligar thesis, Differencing=1
Example 2: neptune.ai catfish sales
result = seasonal_decompose(lim_catfish_sales,model='additive')
fig = result.plot()