# EBSStatistic: Statistic for Profile Comparison In EBS: Exact Bayesian Segmentation

## Description

Posterior probability of profiles having same change-point location

## Usage

 ```1 2``` ```EBSStatistic(x, Conditions = numeric(), Tau = numeric(), K = numeric(), p0=1/2) ```

## Arguments

 `x` An object of class EBSProfiles, outcome of function EBSProfiles applied to matrix of profiles of interest `Conditions` A vector containing the set of index of profiles to compare using posterior probabilities. `Tau` The vector of index of the change-point of interest for each profile. If field is left empty, default value is \$1\$ for all profiles. If only one value is entered, this value is used for all profiles. `K` The vector of number of segments of the segmentation for each profile. If field is left empty, function calls EBSICLProfiles to choose value of K. If only one value is entered, this value is used for all profiles. `p0` The prior probability of having same change-point. If field is left empty, default value is 1/2.

## Details

This function returns p(E_0|Y,K) where:

- Y is the matrix of data: Y=(Y^1, …, Y^I),

- m_l is the segmentation of profile l,

- k_l is the index of the change-point of interest in profile l, and tau_(k_l) is the corresponding change-point,

- E_0 denotes the event tau_(k_1)=...=tau_(k_I),

- q denotes the uniform prior on segmentation m,

- p denotes a probability measure chosen by user for which:

- p_0=p(E_0|K)

Then the function returns

S(Y)=p_0 (1-q_0)q(E_0|Y,K) /[(1-p_0)q_0 q(Y|K) + (p_0-q_0)q(E_0|Y,K)]

## Value

The posterior probability of profiles having same change-point location (see details).

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

Johnson, Kotz & Kemp: Univariate Discrete Distributions

Hall, Kay & Titterington: Asymptotically optimal difference-based estimation of variance in non-parametric regression

`EBSProfiles-class`, `EBSProfiles`, `EBSegmentation`, `EBSICLProfiles`
 ```1 2 3 4 5 6 7 8``` ```# Comparison of 3rd change-point of 2 profiles segmented in 5 and 4 #segments with Poisson model set.seed(1) x1<-c(rpois(125,1),rpois(100,5),rpois(50,1),rpois(75,5),rpois(50,1)) x2<-c(rpois(100,1),rpois(100,3),rpois(75,2),rpois(125,0.5)) M<-rbind(x1,x2) E<-EBSProfiles(M, K=8) out <- EBSStatistic(E,Conditions=c(1,2),Tau=c(3,3),K=c(5,4)) ```