Scan_for_breaks

版本 1.0.0.0 (2.8 MB) 作者: Jakob Dreyer
Scanning timeseries for piecewise constant segments
229.0 次下载
更新时间 2017/5/15

查看许可证

Scans a noisy timeseries for events where the mean value changes abruptly. An example is an ion channel in a metastable state where the conductance jumps between different values. This program searches for the event-points and returns their location and the mean value of the the data between events. The program runs without user supervision and the decision to accept or reject divisions is made according to Rissanen's Minimum Description Length Principle.
[breaks, idealized_x, steplength, stepvalue, jumps] = scan_for_breaks(x, optional lmin)
The input vector 'x' will be scanned for breakspoints using the Minimal Description Length Principle. The parameter 'lmin' is the smallest segment that will be detected by the algorithm and is by default 1. Increasing lmin to 3 or 5 may help if you have many false-positive detections. If called with no arguments, the function generates a 1e5 data point test data set with 20 random segments, searches and displays results.
Outputs:
breaks = indices of break points in x.
idealized_x = piecewise constant time series of same length as x
steplength = number of datapoints in each segment.
stepvalue = mean value of x in each segment
jumps = difference in mean value between neighboring segments
This program is developed for analysis of ion channel recordings, but can be applied for other types of non-stationary data. The important part is that the noise must be uncorrelated.

The algorithm is described in "Unsupervised idealization of ion channel recordings by Minimum Description Length: Application to human PIEZO1-channels" by Radhakrishnan Gnanasambandam, Morten Schak Nielsen, Christopher Nicolai, Frederick Sachs, Johannes Pauli Hofgaard, and Jakob Kisbye Dreyer. Frontiers Neuroinformatics, 11:31, 2017 (https://doi.org/10.3389/fninf.2017.00031)

Examples:
Run on test data:
>>Scan_for_breaks

Generate your own test data with 50 data points being offset from the other. Get location of breakpoints (br) and the idealized segment (x_hat) and plot the results:
>> x = [randn(1,400) randn(1,50)+1 randn(1,400)];
>> [br x_hat] = scan_for_breaks(x);
>> t = 1:length(x);
>> plot(t, x, t, x_hat)

Restrict the shortest segment to be 100 datapoints (with this restriction, the algorithm will often fail to detect the hidden segment of the example above):
>> scan_for_breaks(x, 100)

引用格式

Jakob Dreyer (2024). Scan_for_breaks (https://www.mathworks.com/matlabcentral/fileexchange/60224-scan_for_breaks), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R2016a
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Cluster Analysis and Anomaly Detection 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
版本 已发布 发行说明
1.0.0.0

Updated description text.
Added plot-example in the description
Updated help-text
updated description text
Updated link to publication.
Added pre-print of the manuscript to the zip file.
Clarified description
Updated Description
Clarified description text.