The goal of ocp is to implement Bayesian Online Changepoint Detection, as described:


This is a basic example of how to use the function "onlineCPD" on simulated univariate Gaussian data as input.

 # the true changepoint locations including the first and last point
truecps<- c(1, 51, 71, 121)
#simulate the data
uvg<- c(rnorm(n=diff(truecps)[1], mean=0, sd=2), 
        rnorm(n=diff(truecps)[2], mean=20, sd=4),
        rnorm(n=diff(truecps)[3], mean=10, sd=3))
ocpd_output<- onlineCPD(uvg) 

Try the ocp package in your browser

Any scripts or data that you put into this service are public.

ocp documentation built on May 2, 2019, 3:46 a.m.