Learn R Programming

ocp

The goal of ocp is to implement Bayesian Online Changepoint Detection, as described: https://arxiv.org/abs/0710.3742

Example

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

library(ocp)
 # the true changepoint locations including the first and last point
truecps<- c(1, 51, 71, 121)
#simulate the data
set.seed(1)
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) 

Copy Link

Version

Install

install.packages('ocp')

Monthly Downloads

375

Version

0.1.1

License

GPL-3

Maintainer

Andrea Pagotto

Last Published

April 21st, 2019

Functions in ocp (0.1.1)

const_hazard

Constant hazard function
summary.ocp

Object Summary
print.ocp

Print Object
gaussian_update

Update the gaussian parameters
initOCPD

Initialize ocpd object
negbinpdf

Calculate Negative-binomial on vector of parameters
ocp-package

Bayesian Online Changepoint Detection for Multivariate Data
str.ocp

Object Structure
studentpdf

Calculate Student PDF on vector of parameters
gaussianProb

Compute predictive probabilities based on Gaussian
gaussian_init

Initialize vectors for gaussian probability functions
onlineCPD

Bayesian Online Changepoint Detection
plot.ocp

Plot Object
poissonProb

Compute predictive probabilities based on Poisson
poisson_init

Initialize vectors for poisson probability functions
gamesdata

This is data to be included in the package
findCPprobs

Find Set of Changepoints with Highest probability
gamesdatacounts

This is data to be included in the package
poisson_update

Update the poisson parameters