Finding the change point before a significant increase I have the following time series:
df <- structure(c(288L, 259L, 265L, 293L, 271L, 278L, 300L, 286L, 278L, 
275L, 282L, 285L, 290L, 296L, 296L, 279L, 270L, 292L, 283L, 289L, 
280L, 269L, 289L, 290L, 287L, 271L, 280L, 299L, 278L, 287L, 293L, 
286L, 297L, 281L, 285L, 305L, 288L, 295L, 277L, 292L, 286L, 281L, 
287L, 302L, 292L, 297L, 292L, 279L, 281L, 291L), .Tsp = c(1961, 
2010, 1), class = "ts")

This is the plot:

Questions/Problems


*

*I would like to know, which point in the time series is the start of a significant trend. Applying a Mann-Kendall trend test for the whole time series gives a significant trend. However,by visual inspection, the time series does not have an increasing trend at least over the fisrt half. 

*This is like a changepoint problem, but I am not sure, which detection method is appropriate for this. I just want to determine the point in the time series before the most significant increasing trend. 

*I am thinking of a moving Mann-Kendall trend test and plotting the corresponding tau statistic. But I dont know how to set a threshold value and test the significance of the tau statistics. 
Any suggestions on how to do this correctly in R?
I'll appreciate any help. 
 A: Use mcp if you (1) want to quantify uncertainty about the location of the change point, and (2) want to specify a more informed model structure, e.g., that the first segment is a plateau. I arranged the data so that it is a regular data frame. Then fit an AR(1) model with a plateau + joined slope:
model = list(
  y ~ 1 + ar(1),
  ~ 0 + x
)

library(mcp)
fit = mcp(model, data = df)

You can use summary(fit), plot(fit), and plot_pars(fit) to see the change point. Here's plot:

The distribution of the change point (bottom) is very broad because there is very little information about a change point here (no clear change and quite few data). This is not a weakness to the method - this should be an accurate inference, and other change point methods often completely ignore uncertainty. 
You can help it by specifying more informed priors for the change point location and slope strengths in segment 2.
A: You could use the EnvCpt package in R which fits mean, trend, AR and changepoint models.  It then gives you the best fit of all models and you can use AIC (or another metric) to choose the best model.
library('EnvCpt')
out=envcpt(df)
out$summary # gives the fit and number of parameters for each model
plot(out,type='aic') # plots the aic values, trendcpt+AR2 model is clearly the best
out$trendar2cpt # gives the fit for trendcpt+AR2

The above gives the best model as a Trend+AR2+cpt model (assuming Normal errors) with a changepoint after 6 observations.  I'm not sure you would want to fit a Trend+AR2 model to 6 observations though - but that is your call.
The next lowest AIC value is the Trend+AR2 model.  Thus indicating that there is not a clear changepoint in this data.  This could be that there is not enough data to be confident there is a changepoint at observation 6, or the change is too small (relative to the noise), or a combination.
