Skip to content

ARIMA-style feed analysis: for {BoxCox=T/F, diff=0,1,2}, plot the seasonality and ACF/PACF #1009

Closed
@trentmc

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:
    • decomposition into trend / seasonal / residual PR #1016
    • relative strengths of trend vs seasonality vs resid PR #1025
    • ACF & PACF PR #1026
    • ADF for each transform {0, B0, B1, B2}. (Calc'd it as part of above line. Plots are being done in another issue).

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

Scan 11  May 2024, 10 55 page 2

Other Prototypes & Examples

Prototype: decomposition into trend / seasonality / residual

329284278-d9bbecce-9f5f-415f-be6e-c8da6d5d04b5

Prototype: For differencing=0,B0,B1,B2, show 5 decomposition plots

Scan 11  May 2024, 10 55 page 1

Prototype: For differencing=0,B0,B1,B2, show ACF & PACF

1011

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()

example0

Example 1a: Sikligar thesis, Differencing=0

Ref: Sikligar thesis & code

example1a-differencing0

Example 1b: Sikligar thesis, Differencing=1

Ref: Sikligar thesis & code

example1b-differencing1

Example 2: neptune.ai catfish sales

result = seasonal_decompose(lim_catfish_sales,model='additive')
fig = result.plot()

Ref: neptune.ai catfish, in this neptune.ai post/py code.

example2

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions