est.mean.pois: est.mean.pois

Description Usage Arguments Details Value References Examples

View source: R/est_mean_pois.R

Description

This function estimates the posterior mean for each segments under the Poisson assumption with conjugate prior. The data is assumed to follow Poisson(λ), where λ is assumed to have Beta prior with shape parameters α and β.

Usage

1
est.mean.pois(data.x, index.ChPT, prior)

Arguments

data.x

Observed data in vector form where each element represents a single observation.

index.ChPT

The set of the index of change points in a vector. Must be in accending order. This could be obtained by est.changepoints.

prior

Vector contatining prior parameters in the order of (α, β)

.

Details

See Manual.pdf in "data" folder.

Value

Vector containing estimated mean for each segments.

References

Chao Du, Chu-Lan Michael Kao and S. C. Kou (2015), "Stepwise Signal Extraction via Marginal Likelihood". Forthcoming in Journal of American Statistical Association.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
library(StepSignalMargiLike)

n <- 20
data.x <- rpois(n, 1)
data.x <- c(data.x, rpois(n, 10))
data.x <- c(data.x, rpois(n, 50))
data.x <- c(data.x, rpois(n, 20))
data.x <- c(data.x, rpois(n, 80))
data.x <- matrix(data.x,1)

prior <- c(1,2)
index.ChangePTs <- c(n, 2*n, 3*n, 4*n)
est.mean.pois(data.x, index.ChangePTs, prior)

StepSignalMargiLike documentation built on May 2, 2019, 1:02 p.m.