How to detect trend changes in noise time series? wget -q -O- https://i.stack.imgur.com/xczQ1.gif | tail -c +43

R> with(f, plot(x, log10(y), type='l'))

I have a series whose data is above. It obviously has two parts (separated at around x=1100). What is the most appropriate way to detect such a change in this noisy time series and fit two connected straight line segments to it?
EDIT: It looks like a method along the line of the convex hull would probably be more appropriate? For example, one can start with the lowest-most point and find the edges to the left and right of the lowest point in the convex hull. This way the two segments of support from the above of the points can be easily determined.
Any better ideas?
I don't think the method mentioned by DavidGibson makes the most sense on this dataset.


Eyeballing the time-series suggests discontinuities at t=1100 and t=2100. My recommendation would be to try something like total variation denoising. In total variation denoising, we are trying to solve the following optimization problem:
\begin{align}
\min_{\mathbf{x}} \frac{1}{2} ||\mathbf{y} - \mathbf{x}||_2^2 + \lambda ||\mathbf{D} \mathbf{x}||_1
\end{align}
where
\begin{align}
\mathbf{D} = \begin{bmatrix} -1 & 1 & & & \\ & -1 & 1 & & \\ & & \ddots & & \\ & & & -1 & 1\end{bmatrix}
\end{align}
The matrix operation $\mathbf{D} \mathbf{x}$ imposes a sparsity constraint on the first-order difference of the input signal. On solving for $\mathbf{x}$ with an appropriate regularization constant $\lambda$ and taking the first-order difference, i.e., $\mathbf{D} \mathbf{x}$, should generate spikes at the change points. Applying an appropriate threshold and determining the location of spikes that are above the threshold should help you solve the problem.
