EBSBIC: Model Selection by BIC Criterion

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

View source: R/EBS.R

Description

Computes the exact BIC criterion: -Loglikelihood (data,K) and chooses the optimal number of segments as k= argmin(BIC)

Usage

1
EBSBIC(x, prior=numeric())

Arguments

x

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

prior

A vector of size Kmax giving prior probabilities for segment numbers.

Details

This function is used to choose the optimal K according to the BIC criteria.

Value

NbBIC

An integer containing the choice of the optimal number of segments.

BIC

A vector of length Kmax returning -Loglikelihood (data,K).

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

See Also

EBSegmentation, EBSICL, EBSPostK

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)
bestKBIC=EBSBIC(out)$NbBIC
print(bestKBIC)

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