15

I am new in time series analysis. I am trying to find the trend of a short (1 day) temperature time series and tried to different approximations. Moreover, sampling frequency is 2 minute. The data were collocated for different stations. And I will compare different trends to see whether they are similar or not.

I am facing three challenges in doing this:

Q1 - How I can extract the pattern?

Q2 - How I can quantify the trend since I will compare trends belong to two different places?

Q3 - When can I say two trends are similar or not similar?

jaco0646
  • 15,303
  • 7
  • 59
  • 83
A.Amidi
  • 2,502
  • 5
  • 25
  • 37

1 Answers1

11

Q1 -How I can extract the pattern?

You would start by performing time series analysis on both your data sets. You will need a statistical library to do the tests and comparisons.

If you can use Python, pandas is a good option.

In R, the forecast package is great. Start by running ets on both data sets.

Q2 - How I can quantify the trend since I will compare trends belong to two different places?

The idea behind quantifying trend is to start by looking for a (linear) trend line. All stats packages can assist with this. For example, if you are assuming a linear trend, then the line that minimizes the squared deviation from your data points.

The Wikipedia article on trend estimation is quite accessible. Also, keep in mind that trend can be linear, exponential or damped. Different trending parameters can be tried to take care of these.

Q3 - When can I say two trends are similar or not similar?

  1. Run ARIMA on both data sets. (The basic idea here is to see if the same set of parameters (which make up the ARIMA model) can describe both your temp time series. If you run auto.arima() in forecast (R), then it will select the parameters p,d,q for your data, a great convenience.

  2. Another thought is to perform a 2-sample t-test of both your series and check the p-value for significance. (Caveat: I am not a statistician, so I am not sure if there is any theory against doing this for time series.)

  3. While researching I came across the Granger Test – where the basic idea is to see if one time series can help in forecasting another. Seems very applicable to your case.

So these are just a few things to get you started. Hope that helps.

Ram Narasimhan
  • 22,341
  • 5
  • 49
  • 55
  • could you comment on implementing (1) in Pandas/Python - namely, an auto.arima() equivalent in python. The comments at the following suggest this automization was a work in progress: http://stackoverflow.com/questions/22770352/auto-arima-equivalent-for-python – Quetzalcoatl Jun 06 '15 at 16:24
  • @Ram Please see a follow up on your answer, http://stats.stackexchange.com/questions/172226/proving-similarities-of-two-time-series . – Moe Sep 13 '15 at 14:04
  • A few comments: 1. why restrict yourself to a linear trend line. A better start would probably have been to point the OP towards a standard decomposition tool that will break it into seasonal, trend and random components and uses loess or similar for the trend. 2. Running ARIMA on two datasets will not help you assess if the trends are similar (try it and see - see my answer to http://stats.stackexchange.com/questions/172226/proving-similarities-of-two-time-series. – Peter Ellis Sep 13 '15 at 22:09
  • I know this is an old answer, but I would point out that because the order of data points matters in a time series, running a 2-sample t-test will result in a misleading test statistic. For example, if you reverse the same time series data a 2-sample t-test will always result in a test statistic of `0.0` – Derek O Nov 10 '22 at 22:30