Change point detection

Can you provide a reproducible example? It will make it easier to work out what you are doing. FAQ: What's a reproducible example (`reprex`) and how do I do one?