trough detection in time series I have time series (daily readings), which can trend downwards. I would like to introduce a dichotomous dummy variable that indicates when the time series contains a trough (dummy=1) or not (dummy=0). A trough occurs if the current time series is n% (e.g. 80%) below past values but future values go up again to 100% relative to the current value.
I can look x steps into the past and y steps into the future and take the max of retrospective and future values. This works OK-ish for short troughs (i.e. where the length of the trough is shorter than for example x).
Did anyone attempt something like this in the past? Any pointers would be very much appreciated. 
 A: This is a possible approach, but by using an arbitrarily selected percentage cutoff for the dummy variable, it does not take into account that a percentage deviation below this could also form a structural change in the time series.
For instance, let's say we have a time series that on average, shows about 10% volatility. Then, there is a 50% drop. This is clearly a structural change in the time series relative to its prior trend, but your dummy variable will not pick this up if you have set a threshold higher than this.
The Chow statistic is one example of a test that is used to detect a structural break in a time series.
Suppose that you have 100 observations in your time series. You suspect that there is a structural change at n=30. To test this, you would firstly run three regressions:
1. Regression A: n = [1:30] (Before structural change)
2. Regression B: n = [31:60] (After structural change)
3. Regression P: n = [1:60] (Pooled Regression)
Your Chow statistic would then be calculated as follows:
CHOW = (RSSP – (RSSA+RSSB))/k) / (RSSA+RSSB)/(NA+NB-2k)
where RSS = Residual Sum of Squares, k = number of regressors (including intercept), N = degrees of freedom
The null and alternative hypothesis for this test is as follows:
Null Hypothesis: No structural break in time series
Alternative Hypothesis: Structural break in time series
Therefore, upon finding your f critical value, if you find that the Chow test exceeds this value - you can reject the null hypothesis of no structural break.
You could choose, for instance, to implement a stepwise calculation of the Chow statistic as you move up in observations, and say, have a dummy of 1 if a structural change is detected (you reject the null hypothesis), and a dummy of 0 if you do not.
Additionally, you could set the dummy variable of 1 as only being so if the movement is downwards to account for the trough.
To summarise, you can certainly use the method you described. However, you may miss indications of a trough depending on the threshold you set. By using a more formal statistic, you are able to detect structural changes with more accuracy and relative to the overall trend. Hope this helps.
