Giter Club home page Giter Club logo

changepoints.jl's People

Contributors

bardwell avatar dom-owens-uob avatar fairbrot avatar gdkrmr avatar github-actions[bot] avatar tkelman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

changepoints.jl's Issues

Add Bayesian method

allow a Bayesian analysis to be done.

Uses Particle filtering so quite quick tho slower than PELT

For the user requires
a) Specification of the distribution for the time between chpts (could be Poisson etc)
b) A Marginal likelihood for segments (analogous to cost functions) instead of maximising -2*log likelihood you integratethe likelihood wih respect to prior for parameter. For speed use conjugate priors.

Was thinking of using a macro like the other methods and then returning a new type ChptPosterior then can overload rand() to sample from it.

Segment costs have unintuitive interface

Consider the following cost function:
cost = NormalMeanSegment(x)

Now, the function call cost(s,t) gives the cost of the points x[s+1], ... x[t] rather than x[s], ..., x[t]. This is unintuitive, and may cause problems when users write their own cost functions. It certainly caused me some confusion when working on the binary segmentation algorithm.

TagBot trigger issue

This issue is used to trigger TagBot; feel free to unsubscribe.

If you haven't already, you should update your TagBot.yml to include issue comment triggers.
Please see this post on Discourse for instructions and more details.

If you'd like for me to do this for you, comment TagBot fix on this issue.
I'll open a PR within a few hours, please be patient!

Implementing change point detection for differentioal equation modeling

Hello,
Is there any possibility of adjusting the package to detect change points in ODE modeling? The change point in this term means the current parameters cannot simulate the real dataset anymore, so it shows the model parameters are changed due to unknown reasons. The aim is to detect time points where the parameters are changed and to estimate the new set of parameters.
Thank you in advance for any help and hints.

Create R data sets for unit testing

  • Files of time series for different changes
  • Output of R algorithms in separate files

This data should be put into the directory test/Rdata

Combine with TransitionIndicators.jl to create the ultimate package for identifying changes or transitions in timeseries

Hi there devs of Changepoints.jl.

Recently in JuliaDynamics we started developing a package currently called TransitionIndicators.jl for identifying or forecasting transitions in a timeseries. The package is here: https://github.com/JuliaDynamics/TransitionIndicators.jl . Unfortunately we started working on this package before we found Changepoints.jl. In any case, at the moment the algorithms of the two packages are completely different.

Here is a quick summary of how TransitionIndocators.jl works:

  1. Input timeseries are first transformed into an indicator timeseries using a rolling window. The indicator is a quantity that can forecast an upcoming change. A typical application of this is the so called critical slowing down: the AR1-coefficient of a timeseries increases as we approach a transition. Hence, the AR1 coefficient can be estimated over a rolling window and this gives us the "indicator timeseries".
  2. The indocator timeseries is then transformed into a change metric timeseries using a rolling window. The change metric is a function mapping indicator timeseries windows into real numbers. Its goal is to quantify significant change in the indicator timeserries. In the above Critical Slowing Down example, the change metric is simply the slope of timeseries segment in the window.
  3. Lastly, a significance test is done: we estimate at each time points (at which time windows to be precise) the change metric is significantly higher than the mean change metric of the timeseries. We do this using the method of timeseries surrogates. The best way to understand this is to quickly read through our example here: https://juliadynamics.github.io/TransitionIndicators.jl/dev/tutorial/

Our goal was from the get go to make a software that can do both forecasting of transitions, but also the more established change point detection. Our approach can do both. Let's imagine the simple change point detection scenario of data coming from guassian distributions where the or std changes with time. In the above enumerated list, the indicator is the identity (i.e., the indicator timeseries and input timeseries are one and the same). Then, the change metric timeseries can be anything quantifying distribution distance, such as KL Divergence: we calculate the distance in of the distribution of the first half of the rolling window with the second half of the rolling window. Alternative way is to instead use the pvalue of a Two sample Kolmogorov Smirnov Test between the data of the first and the second half of the window. Significance is once again tested using the method of surrogates.

Changepoints.jl differs in a fundamental way in two parts: first, the "casting timeseries into indicators" part is skipped, and left to the discretion of the user. This isn't really a big change. The biggest change however are the following two points:

  • One, how the change metric is computed: it is the value of a loss function. Conceptually, the change metric is still something similar with our second example: it is some distance from some other reference distribution.
  • Two, how the significance is estimated: here significance is simply when the cost function is smallest or falls below a threshold.

Due to these considerations, we believe that we can merge the two approaches. The steps 1. and 2. that are part of the pipeline of current TransitionIndicators.jl stay as they are. Part 3 becomes modular, and allows users to choose different ways of how to estimate significance "change" in the "change metric timeseries" either via surrogate testing or via minimization of a cost function.

Please let us know what you think of this plan and whether it seems sensible. Please also let us know whether you are still developing this Changepoints.jl repository, or whether it is in purely maintance mode, or whether it is compeltely archived and no new development effort will be spent here (it is not clear from the GitHub page unfortunately).

cc @JanJereczek

Fix PELT/segment cost functions so Julia output matches R output

I've written an R comparison test. The PELT output for the Normal segment costs seems to match but the others don't. In the case of the Gamma comparison I did not know what shape parameter to use. Also, I could not run a test for the Nonparametric cost functions as the changepoint file for this contained much more output than just the changepoints.

The tests can be redone by running Pkg.test("Changepoints")

Test Normal mean change...
Changepoint distribution is Normal with changing mean and fixed variance
    Success!
Test Normal variance change...
Changepoint distribution is Normal with fixed mean and changing variance
    Success!
Test Normal mean and variance chaange...
Changepoint distribution is Normal with changing mean and changing variance
    Success!
Test Poisson change...
Changepoint distribution is Poisson with changing mean
Fail:
    R Changepoints: [0,85,228,360,438,500]
    Julia Changepoints: [0,85,228,360,438]
Test Poisson change...
Changepoint distribution is Exponential with changing mean
Fail:
    R Changepoints: [0,228,361]
    Julia Changepoints: [0,228,361,424]
Test Gamma rate change...
Changepoint distribution is Gamma with fixed shape and changing rate
Fail:
    R Changepoints: [0,83,228,360,438,500]
    Julia Changepoints: [0,83,228,360,438]

Tag a new release?

The latest tagged version of Changepoints is holding Distributions back to pre 0.25, which is causing problems for downstream libraries:

(jl_ucu4aZ) pkg> st -o -m
Status `/tmp/jl_ucu4aZ/Manifest.toml`
⌅ [31c24e10] Distributions v0.24.18 (<v0.25.75): Changepoints
⌅ [1a297f60] FillArrays v0.11.9 (<v0.13.4): Distributions
⌅ [276daf66] SpecialFunctions v1.8.7 (<v2.1.7): Distributions
⌅ [4c63d2b9] StatsFuns v0.9.18 (<v1.0.1): Distributions

Looks like a6c3dac already bumped it on master, but it needs a tag.

BanchmarkLite package is obsolete

Could you add some other suitable Benchmark package (supported by the recent Julia Pkg) instead of BenchmarkLite? BechmarkLite is a completely dead project.

See ... perf.jl

Unable to install v0.4.1

I am trying to install Changepoints v0.4.1 to be able to update Distributions. I can install v0.4.0 but not 0.4.1.(see below). I will appreciate any help.
Laurent

(@v1.8) pkg> add [email protected]
   Resolving package versions...
ERROR: Unsatisfiable requirements detected for package Changepoints [98700a41]:
 Changepoints [98700a41] log:
 ├─possible versions are: 0.3.0-0.4.0 or uninstalled
 └─restricted to versions 0.4.1 by an explicit requirement — no versions left

Installing required packages

Include some code to download required packages if not already installed on the users computer (Distributions, Winston, Docile, Beta.Meta).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.