# Segmented Regression of a Seasonal Time-series in R

I have a time-series of diurnal temperature range (DTR), 1961 - 2013 from a single weather station. Visually, the first part of the TS seems to have a downward trend, so I used the package segmented to verify, and specifying 4 break points the downward trend is confirmed.

A downward trend would be significant for my research, but I want to avoid confirmation bias. Could the trend be an artefact of the strong seasonality of the TS?

Using changepoints to search for step changes of mean value confirms the segmented regression findings, but after attempting to deseasonalize the series by differencing it with lag = 371 days (the maximum ACF value), the trend is completely different.

What I want to ask is: Is it correct to apply segmented regression (and/or changepoints detection) to the raw time-series, or does it need to be pre-processed somehow first?

• changepoint detection needs to be done in concert with pulse detection , time trend detection , seasonal pulse detection , local time trends AND of course SARIMA detection. – IrishStat May 16 at 22:26
• I am positively not trying to predict the future of this time-series, and I am only concerned with the seasonal structure only insofar it impacts what I am actually after: the local time-trends, and in second place the global time-trend. I'd like to minimize the workload and focus on my targets. – Fabio Capezzuoli May 17 at 3:22
• Whether or not you are trying to predict or to characterize , the same advice holds. One needs to segment signal and noise of the time series in order to clearly see the intrinsic patterns. – IrishStat May 17 at 7:34
• Does changepoints account for serial correlation and seasonality? If not, you cannot trust its results--the approach may be right but the software could be wrong. I cannot find documentation of any changepoints function in the segmented package. – whuber May 17 at 19:08
• it does not ... – IrishStat May 17 at 20:08