EBSPostK: Posterior probabilities of the number of segments

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/EBS.R

Description

For a single profile, computes the posterior probabilities of the number of segments given its prior.

Usage

1
EBSPostK(x, prior=numeric())

Arguments

x

An object of class EBS returned by function EBSegmentation applied to data of interest.

prior

A vector of length Kmax giving prior probabilities on the value of K. Default value is uniform on 1:Kmax.

Details

This function computes the posterior probabilities of the number of segments, so that the user can use Bayesian Model Averaging.

Value

A vector of size Kmax containing the probability of each of the number of segments.

Author(s)

Alice Cleynen

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, EBSBIC, EBSICL

Examples

1
2
3
4
5
6
# 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)
Posterior<-EBSPostK(out)
plot(Posterior, type='b')

EBS documentation built on May 29, 2017, 5:49 p.m.