Changepoint analysis/ findchangepts: How does it work?
조회 수: 47 (최근 30일)
이전 댓글 표시
I am using the function findchangepts and use 'linear' which detects changes in mean and slope. How does it note a change? Is it by consecutive points until the next point has a different mean and slope?
Mathworks has the following explanation:
If x is a vector with N elements, then findchangepts partitions x into two regions, x(1:ipt-1) and x(ipt:N), that minimize the sum of the residual (squared) error of each region from its local mean.
How does the function get ipt?
Thanks in advance!
I am working with a single vector with N elements.
댓글 수: 0
답변 (1개)
Manvi Goel
2020년 10월 29일
The funtion findchangepts partitions the vector x into two regions and calculates sum of the residual (squared) error of each region from its local mean for both a and b (mean squared error).
It will finally return the index pt such that the error calculated previously is minimum for both.
Consider x a vector with N elements as
x = [1, 3, 5, 6, 7, 8]
a = x(1:i - 1), b = x(i:n) where i ranges from 2 through n
a = [1], b = [3, 5, 6, 7, 8] where i = 2, residual sum for a = 0, b = 14.8
a = [1, 3], b = [5, 6, 7, 8] where i = 3, residual sum for a = 2, b = 5
a = [1, 3, 5], b = [6, 7, 8] where i = 4, residual sum for a = 8, b = 2
a = [1, 3, 5, 6], b = [7, 8] where i = 5, residual sum for a = 14.75, b = 0.5
a = [1, 3, 5, 6, 7], b = [8] where i = 6, residual sum for a = 23.2, b = 0
Here the function findchangepts will return pt = 3, since error is minimum for i = 3 which is 2 and 5 resp.
You can also refer to the MATLAB documentation here https://in.mathworks.com/help/signal/ref/findchangepts.html
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Multirate Signal Processing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!