postcp: Characterize uncertainty in change-point estimates.

Description Usage Arguments Details Value Author(s) References Examples

Description

The functions are used for change-point problems, after an initial set of change-points within the data has already been obtained. The function postCP obtains estimates of posterior probabilities of change-points and hidden states for each observation.

Usage

1
postcp(formula, data, bp=integer(), family = gaussian(), sigma=1.0, maxFB = FALSE)

Arguments

formula

An object of class "formula" (or one that can be coerced to that class): a symbolic description of the model to be fitted. The details of model specification are as given in glm.

data

A matrix of data to be segmented. Must have no missing values

bp

break points. i.e. For K segments, a vector of K-1 initial estimates of change-point locations, corresponding to the index of the last observation of the first K-1 segments.

family

Emission distribution of the observed data as in glm. Supports Poisson(default), Gaussian, Negative Binomial and Gamma distributions.

sigma

Value added to sigma for gaussian data

maxFB

If maxFB = TRUE : call maxFwBk if the most probable change point configuration is required otherwise marginal distributions for change points are returned

Details

Package: postCP
Type: Package
Version: 1.8.0
Date: 2016-09-07
License: GPL (>= 2)
LazyLoad: yes

Estimates posterior probabilities of change in distribution and state probabilities in segmentation problems through the forward-backward algorithm using a restricted hidden Markov model.

The user can input a data matrix and specify the formula required. The package will estimate the initial regression coefficients through the change point model. It will then calculate the posterior change point probabilities and will update the parameter estimates and the log evidence.

Value

model

Emission distribution (Poisson, Normal, Gamma, Binomial).

n

Length of segmented data

loglik

loglikelihood matrix

post

Posterior probability distribution

post.cp

Posterior change point probability distribution

le.updated

Updated Log Evidence matrix

param.before

Initial regression coefficients

param.updated

Updated regression coefficients using postCP

response.variable

Response variable of the data input

Author(s)

Gregory Nuel, The Minh Luong and Malith Jayaweera

Maintainer: Who to complain to malithgsoc2016@gmail.com

References

Luong, T.M., Rozenholc, Y. & Nuel, G. (2012). Fast estimation of posterior probabilities in change-point models through a constrained hidden Markov model. http://arxiv.org/pdf/1203.4394

Rabiner, L.R. (1989) A tutorial on hidden Markov models and selected applications in speech recognition. 77(2):257-286.

Viterbi, A.J. (1967) Error bounds for convolutional codes and an asymptotically optimum decoding algorithm. IEEE Transactions on Information Theory. 13(2): 260-269.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
require(postCP)
#prepare data
sigma=1.3
#Change point estimates
bp=c(7,10)
#Obtain data from longley dataset
data = longley
#Apply postcp function
res = postcp(Employed ~ GNP + Armed.Forces,family=gaussian(),data=data,bp=c(7,10),sigma)

#Plot the results
plot.postcp(res,main="Posterior Change Point Probability Distribution")

#Apply postcp function with maxFB=TRUE to obtain marginal distribution
res = postcp(Employed ~ GNP + Armed.Forces,family=gaussian(),data=data,bp=c(7,10),sigma,maxFB=TRUE)

#Plot the results
plot.postcp(res,main="Posterior Change Point Probability Distribution")

malithj/postCP documentation built on May 21, 2019, 11:22 a.m.