1

I am trying to decompose a Time Series, however my data does not have Dates, it is composed of entries taken at regular (and unknown) time intervals.

This solution is great and exactly what I want, however it assumed that my series has a datetime index, which it does not.

I can estimate the frequency parameter in this specific case, however this will need to be automated for different data, and as such I can not use the freq parameter of the seasonal_decompose function (unless there is some way to automatically calculate this) to make do for the fact that my series lacks a datetime index.

azthec
  • 173
  • 9
  • If you don't have a known frequency, how could you decompose the seasonal component out? If you know the frequency, even just a guess, you can use the seasonal_decompose. – TYZ Mar 09 '18 at 14:28
  • I have specifically said in my post that I cannot use the frequency parameter of the seasonal_decompose function, unless I can programatically estimate it somehow, because I can manually analyze this time series, but I will not be able to manually analyze the real time series my program will be tested against. – azthec Mar 09 '18 at 14:38
  • It doesn't make sense to do seasonal decomposition without a frequency.. you should be able to get those matadata related to your time series data somehow, especially if it is coming in real time, there should always be a collection frequency. – TYZ Mar 09 '18 at 14:40
  • One possible solution to this is to determine a seasonal frequency from the data. For example from analysis I can conclude that a very obvious seasonal frequency is 666.66, from analysi of the graph and the autocorrelation plot, however I do not know how to automate this proccess. – azthec Mar 09 '18 at 15:04
  • When you say `I can estimate the frequency parameter in this specific case,`, do you mean by hand or programmatically? If it's programmatically, you should be able to automate it. If it's only by hand, you'll need to find a way to do it programatically – Maarten Fabré Mar 09 '18 at 15:05
  • @MaartenFabré I determined the seasonal frequency from graphical analysis, and in that case the seasonal_decompose function works flawlessly, however I do not know how to automate this process. – azthec Mar 09 '18 at 15:07
  • You can look at the frequencies of the noise with `np.fft.fftfreq`. If there is seasonal variation, you might see it there – Maarten Fabré Mar 09 '18 at 15:08
  • @azthec I think your real problem here is about how to determine your frequency automatically rather than doing decomposition without a frequency... – TYZ Mar 09 '18 at 15:08
  • 1
    On a side note. If you know the frequency is regular, does it matter what this frequency is for the analysis? – Maarten Fabré Mar 09 '18 at 15:34

1 Answers1

1

I have managed to estimate season lenght by utilizing the seasonal python package.

Using fit_seasons function and then seeing the lenght of the returned seasons.

azthec
  • 173
  • 9