The functions are used for change-point problems. Given a loss function (Poisson, Normal homoscedastic, Negative Binomial or Normal Heteroscedastic (with given constant mean)), the function Segmentor estimates the optimal segmentation with respect to the log-likelihood. The Segmentor gives estimates of the breakpoint locations as well as the loss function parameter of each segment.
A vector of observations to be segmented. Must have no missing values.
model
Integer between 1 and 4 giving the modelisation of the observed data, 1: poisson (default), 2: normal-homoscedastic, 3: negative binomial or 4: normal-heteroscedastic
Kmax
The maximum number of segments wanted for the data. The Segmentor will find all optimal segmentations in 1 to Kmax segments.
phi
Needed only for the Negative Binomial distribution: the value of the inverse of the overdispersion parameter. If the user does not enter a value, the package uses a modified version of Johnson and Kotz's estimator where the mean is replaced by the median.
m
Needed only for Normal Heteroscedastic distribution: the value of the constant mean. If not entered, the function uses the empirical mean of the data.
keep
a boolean stating whether or not to keep Cost and Position matrices
compress
A boolean stating whether data should be compressed prior to segmentation
Details
Package:
Segmentor3IsBack
Type:
Package
Version:
1.5
Date:
2013-03-25
License:
GPL (>= 2)
Value
data
The vector of observations to be segmented.
model
Emission distribution (Poisson, Normal Homoscedastic, Negative Binomial or Normal Heteroscedastic)
breaks
Matrix of size Kmax*Kmax of estimated change-point locations for each optimal segmentation in 1 to Kmax segments.
parameters
Matrix of size Kmax*Kmax which elements are the estimated parameters for each segment of the optimal segmentation. If model is Poisson or Normal, the parameter corresponds to the mean of the signal in each segment. If model is Negative binomial, the parameter corresponds to the success-probability of the signal in each segment. If model is normal heteroscedastic, the parameter is the variance assuming known mean.
likelihood
Vector of size Kmax of resulting negative log-likelihood for each optimal segmentation.
Cost
Matrix of size Kmax x n containing the cost of the segmentation of signal up to point j in i segments
Pos
Matrix of size Kmax x n containing the last change-point location of the segmentation of signal up to point j in i segments
overdispersion
only if model = Negative Binomial, the value of the inverse of overdispersion used for the segmentation
mean
only if model = Normal Heteroscedastic, the value of the mean used for the segmentation
compression
The value of the compression factor used (compression>=1)
Author(s)
Alice Cleynen, Michel Koskas and Guillem Rigaill
Maintainer: Who to complain to <alice.cleynen@agroparistech.fr>
References
PDPA: Rigaill, G. Pruned dynamic programming for optimal multiple change-point detection: Submittedhttp://arxiv.org/abs/1004.0887
PDPA: Cleynen, A. and Koskas, M. and Lebarbier, E. and Rigaill, G. and Robin, S. Segmentor3IsBack: an R package for the fast and exact
segmentation of Seq-data: Submittedhttp://arxiv.org/abs/1204.5564
overdispersion parameter: Johnson, N. and Kemps, A. and Kotz, S. (2005) Univariate Discrete Distributions: John Wiley & Sons
variance parameter: Hall, P. and Kay, J. and Titterington, D. (1990): Asymptotically optimal difference-based estimation of variance in non-parametric regression Biometrika
Examples
require(Segmentor3IsBack);
N=2000
x=c(rpois(N,2.0),rpois(2*N,2.2),rpois(N,1.9));
res=Segmentor(data=x,Kmax=3);
# Finds the optimal segmentation in 1, 2 and 3 segments with respect to
#the Poisson model.
y=c(rnbinom(N,prob=0.3,size=0.15),rnbinom(2*N,prob=0.1,size=0.15),
rnbinom(N,prob=0.6,size=0.15),compress=FALSE)
res2=Segmentor(y, model=3,Kmax=10);
#Finds the optimal segmentation in 1 to 10 segments with respect to
#the Negative Binomial model, without compression of data.
Results
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(Segmentor3IsBack)
Segmentor3IsBack v1.8 Loaded
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/Segmentor3IsBack/Segmentor.Rd_%03d_medium.png", width=480, height=480)
> ### Name: Segmentor
> ### Title: Segmentor
> ### Aliases: Segmentor print.Segmentor Segmentor.default
> ### Keywords: R-package PDPA Segmentation
>
> ### ** Examples
>
> require(Segmentor3IsBack);
> N=2000
> x=c(rpois(N,2.0),rpois(2*N,2.2),rpois(N,1.9));
> res=Segmentor(data=x,Kmax=3);
> # Finds the optimal segmentation in 1, 2 and 3 segments with respect to
> #the Poisson model.
>
> y=c(rnbinom(N,prob=0.3,size=0.15),rnbinom(2*N,prob=0.1,size=0.15),
+ rnbinom(N,prob=0.6,size=0.15),compress=FALSE)
> res2=Segmentor(y, model=3,Kmax=10);
> #Finds the optimal segmentation in 1 to 10 segments with respect to
> #the Negative Binomial model, without compression of data.
>
>
>
>
>
> dev.off()
null device
1
>