#StackBounty: #time-series #arima #trend #change-point Working with Time Series: What drives a trend change?

Bounty: 50

I’m working with a time series that had a clear trend changepoint where it went from having an upward trend to a downward trend (After accounting for seasonality).

The problem that I’m running into is that many of the techniques I know assume a stationary time series – if I go and make this time series stationary than I cant go and find out whats impacting the trend because the trend is just gone.

What techniques exist to find what other features/regressors could be driving that trend change? Can I just simply do a time series decomposition and regress some features onto the trend component? Is there anything more robust?

edit: Here’s a fake generated time series with a similar pattern to what I’m working with (I manually added in seasonality), just note I didn’t incorporate any regressors into this dataset despite that being a key part of my problem (since I’m not quite sure how to model it, I probably shouldnt make a generative model with it):

x1 = np.random.normal(0.06, 0.0025, size=106)
time = np.arange(106)
changept = 60
time2 = (time > changept)
trend = time2*time - changept*time2
y = 0.0015*time + x1 + trend*-0.00225
dates = pd.date_range('2012-06-10', '2014-06-15', freq='W')
seasonality = np.array([-0.0109,-0.0077,-0.0037,-0.0032,
 -0.0071,-0.0107,-0.0088,-0.0027,0.0009,-0.0024,-0.0086,
 -0.0103,-0.0055,-0.0005,-0.0025,-0.0106,-0.0166,-0.0141,-0.0057,
 0.0008,0.0022,0.003,0.0082,0.0159,0.0188,0.0133,0.0051,0.0029,
 0.0084,0.0143,0.0126,0.0049,0.0002,0.0048,0.0153,0.0222,0.0205,
 0.0135,0.0078,0.0061,0.0059,0.0046,0.0027,0.0019,0.001,-0.0027,
   -0.0097,-0.0161,-0.0177,-0.0149,-0.0119,-0.0113,-0.0111,-0.0085,
   -0.0043,-0.0029,-0.0062,-0.0103,-0.0095,-0.0038,0.0007,-0.0013,
    -0.0076,-0.0106,-0.0066,-0.001,-0.0015,-0.009,-0.0161,-0.0151,-0.0073,
     0.0001,0.0022,0.0026,0.0069,0.0146,0.0189,0.0148,0.0063,0.0026,
     0.0071,0.0136,0.0136,0.0064,0.0004,0.0033,0.0134,0.0216,
     0.0214,0.0148,0.0085,0.0062,0.006,0.0049,0.003,0.002,
     0.0013,-0.0018,-0.0084,-0.0152,-0.0178,-0.0156,-0.0123,
     -0.0112,-0.0113,-0.0091])

y += seasonality

df = pd.DataFrame({'y':y, 'changepoint':time2*1}, index=dates)


Get this bounty!!!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.