deepcharles / ruptures

ruptures: change point detection in Python
BSD 2-Clause "Simplified" License
1.61k stars 163 forks source link

PELT Multivariate implementation #187

Closed Irfanwustl closed 3 years ago

Irfanwustl commented 3 years ago

Thanks a lot for this great tool. In the review paper it is mentioned that ruptures can work on both univariate and multivariate data. I am using PELT from ruptures. I think the PELT paper referred by ruptures is for univariate data. How is the multivariate version of PELT implemented here?

deepcharles commented 3 years ago

Hello,

You can apply PELT on your multivariate signal the same way you would if the signal was univariate. Just be careful that multivariate signals must have shape (n_samples, n_dims).

Cheers

Irfanwustl commented 3 years ago

Yes. I have applied it and it is working. However, as I am going to write a paper on my project and will cite the ruptures library, I wanted to know how you extend PELT from univariate to multivariate. If I understand correctly, the PELT paper you referred is for univariate data (though the PELT authors have published a recent algorithm for the multivariate case)

deepcharles commented 3 years ago

If you use the L2 cost, then the cost function is given in Equation C2. And it works in the multivariate setting. It detects change of means only.

In the article you mentioned, the cost function can also cope with multivariate data, but is more complex and currently not implemented.

deepcharles commented 3 years ago

Closing now. Feel free to reopen.