Learn R Programming

EBS (version 3.1)

EBSPlotProba: Plot distribution of changepoints of one profile

Description

Given a profile and its number of segments, plots the posterior distribution of each of the change-points

Usage

EBSPlotProba(x,K,data=FALSE, file=character(), type='pdf')

Arguments

x
An object of class EBS returned by function EBSegmentation applied to data of interest.
K
The number of segments of the segmentation for which the posterior distributions are wanted. Must have 2
data
A logical vector. If TRUE, the data is plotted as well as the posterior distributions. By default, data=FALSE.
file
An object of type string. If filled, the plot is saved in a file which name is given by the file argument, and which type is given by argument type.
type
An object of type string. If file is filled, argument type determines the type of the file saved. Possible values are 'pdf', 'png' and 'ps'. By default, 'pdf' is used.

Value

A plot of the posterior distributions.

Details

For a single profile, this function is used to plot the posterior distribution of all changepoints of a segmentation in K segments.

References

Rigaill, Lebarbier & Robin (2012): Exact posterior distributions over the segmentation space and model selection for multiple change-point detection problems Statistics and Computing

Cleynen & Robin (2014): Comparing change-point location in independent series Statistics and Computing

See Also

EBSegmentation, EBSDistrib

Examples

Run this code
# changes for Poisson model
set.seed(1)
x<-c(rpois(125,1),rpois(100,5),rpois(50,1),rpois(75,5),rpois(50,1))
out <- EBSegmentation(x,model=1,Kmax=20)
EBSPlotProba(out,4)
EBSPlotProba(out,4,data=TRUE,file="mysegmentation.png",type='png')

Run the code above in your browser using DataLab