Learn R Programming

EBS (version 2.8)

EBSProfiles: Exact Bayesian Segmentation for multiple profiles

Description

For each profile i, calculates the bayesian probability of each segmentation in 1 to K[i] segments (assuming the data is poisson, normal or negative binomial distributed) and returns object of class EBSProfiles.

Usage

EBSProfiles(data=numeric(), model=1, K = 3, hyper = numeric(), 

theta = numeric(), var = numeric(), homoscedastic = FALSE, unif= TRUE)

Arguments

data
A matrix where each line contains the data of one profile within which you wish to find changepoints.
model
Model under which each profile is assumed to be distributed. Possible values are 1 for Poisson, 2 for Normal Homoscedastic, 3 for Negative Binomial and 4 for Normal Heteroscedastic.
K
A vector containing the maximum number of segments for the segmentation of each profile. Function will explore the set of all possible segmentations in k segments for k in 1 to K[i]. If length(K)=1, the same value of K will be used for each profile.
hyper
The set of hyper-parameters for the prior on the data-distribution. If model is Poisson the conjugate law is Gamma and 2 parameters are needed for each profile (ie vector of length 2*(number of profiles)). If model is Negative Binomial the conjugate is Be
theta
If model=3 (Negative binomial), the vector of values of the inverse of the overdispersion parameter for each profile. If the user does not give his own hyperparameters, the package uses a modified version of Johnson and Kotz's estimator where the mean is
var
If model=2 (Normal Homoscedastic), the vector of values of the variance. If the user does not give his own hyperparameters, the package uses Hall's estimator whith d=4. If homoscedastic is TRUE, the mean of the estimate over all profile is used, else one
homoscedastic
If model=2 (Normal Homoscedastic) or model=3, indicates whether the fixed parameter (variance or overidspersion) is common for all profiles or is profile-specific.
unif
A boolean stating whether prior on segmentation is uniform given number of segments. If false, then the prior favors segmentation with segments of equal length, i.e. n_r is proportional to the inverse of segment length.

Value

  • An object of class "EBSProfiles".
  • modelEmission distribution (Poisson, Normal Homoscedastic, Negative Binomial or Normal Heteroscedastic)
  • lengththe length of each profile
  • NbConditionsthe number of profiles
  • Kthe maximum number of segments for the segmentation for each profile
  • HyperParametersThe hyperparameters used for the prior on the data distribution for each profile
  • Variancethe vector of variances if model is Normal Homoscedastic
  • overdispersionthe vector of overdispersions if model is negative Binomial
  • Lia list (one element per profile) of matrix of size Kmax*(length+1). Element [i,j] is the log-probability of interval [1,j[ being segmented in j segments
  • Cola list (one element per profile) of matrix of size (length+1)*Kmax. Element [i,j] is the log-probability of interval [i,n] being segmented in i segments
  • Pa list (one element per profile) of matrix of size (length+1)*(length+1). Element [i,j] is the log-probability of interval [i,j[

Details

This function is used to compute the matrix of segment probabilities assuming data is poisson, normal or negative binomial distributed. The probability of each interval being divided in k segments (k in 1 to Kmax) is computed.

References

Rigaill, Lebarbier & Robin: Exact posterior distributions over the segmentation space and model selection for multiple change-point detection problems Arxiv:1004.4347

Johnson, Kotz & Kemp: Univariate Discrete Distributions

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

See Also

EBSegmentation

Examples

Run this code
# changes for 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(125,3),rpois(75,4),rpois(75,1),rpois(125,8))
M<-rbind(x1,x2)
out <- EBSProfiles(M,model=1,K=10)

Run the code above in your browser using DataLab