Description Usage Arguments Details Value References Examples
View source: R/est_mean_pois.R
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 β.
1 | est.mean.pois(data.x, index.ChPT, prior)
|
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 |
prior |
Vector contatining prior parameters in the order of (α, β) |
.
See Manual.pdf in "data" folder.
Vector containing estimated mean for each segments.
Chao Du, Chu-Lan Michael Kao and S. C. Kou (2015), "Stepwise Signal Extraction via Marginal Likelihood". Forthcoming in Journal of American Statistical Association.
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.