How to detect abrupt changes in an array with condition?
Show older comments
I have an array of 45000 values. I need to detect the change points within a limited value from this array. Eg: let the values be 182 161 132 92 53 39 62 92 131 165 185. I need to find the change points from 132 to 131 in this series,ie. it should only detect the points which will recover to almost the same point where it deviates. How can i use ischange or findchangepts to find these points?
Answers (1)
Steven Lord
on 3 May 2019
Asking for ischange on your small data set without any options indicates that every point other than the first is a change point.
x = [182 161 132 92 53 39 62 92 131 165 185];
ic = ischange(x);
[x; ic]
I would specify some of the options for ischange. For example, if I know I want to find at most three change points:
ic2 = ischange(x, 'MaxNumChanges', 3);
[x; ic2]
This identifies the 132-92 transition and the 92-131 transition as change points. Changing the METHOD input or specifying a 'Threshold' for what constitutes an "abrupt" change in the data may help isolate the specific significant changes you seek.
Categories
Find more on Argument Definitions in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!