Title: | Step-Wise Signal Extraction via Marginal Likelihood |
---|---|
Description: | Provides function to estimate multiple change points using marginal likelihood method. See the Manual file in data folder for a detailed description of all functions, and a walk through tutorial. For more information of the method, please see Du, Kao and Kou (2016) <doi:10.1080/01621459.2015.1006365>. |
Authors: | Chao Du, Chu-Lan Michael Kao, Samuel Kou |
Maintainer: | Chu-Lan Michael Kao <[email protected]> |
License: | GPL (>= 2) |
Version: | 2.6.0 |
Built: | 2025-03-07 04:03:29 UTC |
Source: | https://github.com/cran/StepSignalMargiLike |
(See the Manual.pdf file in data folder for a detail description of all functions, and a walkthrough tutorial.)
This packages provides function to estimate multiple change points using marginal likelihood method proposed by Du, Kao and Kou (2015), which we would denoted as DKK2015 afterward. est.changepoints
estimates change-points. PlotChangePoints
plots. Other functions are for the normal and Poisson examples in DKK2015.
Package: | StepSignalMargiLike |
Type: | Package |
Version: | 2.5.9 |
Date: | 2017-8-22 |
License: | GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 |
Chao Du, Chu-Lan Michael Kao, Samuel Kou
Maintainer: Chu-Lan Michael Kao <[email protected]>
Chao Du, Chu-Lan Michael Kao and S. C. Kou (2016), "Stepwise Signal Extraction via Marginal Likelihood"
n <- 5 data.x <- rnorm(n, 1, 1) data.x <- c(data.x, rnorm(n, 10,1)) data.x <- c(data.x, rnorm(n, 2,1)) data.x <- c(data.x, rnorm(n, 10,1)) data.x <- c(data.x, rnorm(n, 1,1)) data.t <- 1:(5*n) prior <- prior.norm.A(data.x) max.segs <- 10 index.ChPT <- est.changepoints(data.x, mode="normal", prior) est.mean <- est.mean.norm(data.x, index.ChPT, prior) PlotChangePoints(data.x, data.t, index.ChPT, est.mean) PlotChangePoints(data.x, data.t, index.ChPT, est.mean, type.data="p", col.data="green", col.est="black", main="Stepwise Signal Estimation", sub="Using Marginal Likelihood", xlab="time", ylab="value")
n <- 5 data.x <- rnorm(n, 1, 1) data.x <- c(data.x, rnorm(n, 10,1)) data.x <- c(data.x, rnorm(n, 2,1)) data.x <- c(data.x, rnorm(n, 10,1)) data.x <- c(data.x, rnorm(n, 1,1)) data.t <- 1:(5*n) prior <- prior.norm.A(data.x) max.segs <- 10 index.ChPT <- est.changepoints(data.x, mode="normal", prior) est.mean <- est.mean.norm(data.x, index.ChPT, prior) PlotChangePoints(data.x, data.t, index.ChPT, est.mean) PlotChangePoints(data.x, data.t, index.ChPT, est.mean, type.data="p", col.data="green", col.est="black", main="Stepwise Signal Estimation", sub="Using Marginal Likelihood", xlab="time", ylab="value")
Supported C++ function used in function est.changepoints
.
ChangePointAnalyzeNorm
ChangePointAnalyzeNorm
n <- 5 max.segs <- 5 data.x <- rnorm(n, 1, 1) data.x <- c(data.x, rnorm(n, 10,1)) data.x <- c(data.x, rnorm(n, 2,1)) data.x <- c(data.x, rnorm(n, 10,1)) data.x <- c(data.x, rnorm(n, 1,1)) data.t <- 1:(5*n) prior <- prior.norm.A(data.x) ChangePointAnalyzeNorm(data.x, n, max.segs, prior)
n <- 5 max.segs <- 5 data.x <- rnorm(n, 1, 1) data.x <- c(data.x, rnorm(n, 10,1)) data.x <- c(data.x, rnorm(n, 2,1)) data.x <- c(data.x, rnorm(n, 10,1)) data.x <- c(data.x, rnorm(n, 1,1)) data.t <- 1:(5*n) prior <- prior.norm.A(data.x) ChangePointAnalyzeNorm(data.x, n, max.segs, prior)
Supported C++ function used in function est.changepoints
.
ChangePointAnalyzeNormUnRes
ChangePointAnalyzeNormUnRes
n <- 5 data.x <- rnorm(n, 1, 1) data.x <- c(data.x, rnorm(n, 10,1)) data.x <- c(data.x, rnorm(n, 2,1)) data.x <- c(data.x, rnorm(n, 10,1)) data.x <- c(data.x, rnorm(n, 1,1)) data.t <- 1:(5*n) prior <- prior.norm.A(data.x) ChangePointAnalyzeNormUnRes(data.x, n, prior)
n <- 5 data.x <- rnorm(n, 1, 1) data.x <- c(data.x, rnorm(n, 10,1)) data.x <- c(data.x, rnorm(n, 2,1)) data.x <- c(data.x, rnorm(n, 10,1)) data.x <- c(data.x, rnorm(n, 1,1)) data.t <- 1:(5*n) prior <- prior.norm.A(data.x) ChangePointAnalyzeNormUnRes(data.x, n, prior)
Supported C++ function used in function est.changepoints
.
ChangePointAnalyzePoiss
ChangePointAnalyzePoiss
n <- 20 max.segs <- 5 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)) prior <- prior.pois(data.x) ChangePointAnalyzePoiss(data.x, n, max.segs, prior)
n <- 20 max.segs <- 5 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)) prior <- prior.pois(data.x) ChangePointAnalyzePoiss(data.x, n, max.segs, prior)
Supported C++ function used in function est.changepoints
.
ChangePointAnalyzePoissUnRes
ChangePointAnalyzePoissUnRes
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)) prior <- prior.pois(data.x) ChangePointAnalyzePoissUnRes(data.x, n, prior)
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)) prior <- prior.pois(data.x) ChangePointAnalyzePoissUnRes(data.x, n, prior)
This function estimates multiple change points using marginal likelihood method proposed by Du, Kao and Kou (2015), which we would denoted as DKK2015 afterward.
est.changepoints(data.x, model, prior, max.segs, logH, logMD)
est.changepoints(data.x, model, prior, max.segs, logH, logMD)
data.x |
Observed data in vector or matrix form. When the data is in matrix form, each column should represent a single observation. |
model |
The specified distributional assumption. Currently we have implemented two arguments: "normal" (data follows one dimensional Normal distribution with unknown mean and variance) and "poisson" (data follows Poisson distribution with unknown intensity). A third argument "user" is also accepted, given that the prior and the log marginal likelihood function are specified in the parameter prior and logMD. |
prior |
The prespecified prior parameters in
consistent with the form used in |
max.segs |
(Opt.) The maximum number of segments allowed, which is the value M in DKK2015. Must be a positive integer greater then 1. If missing, the function would process using the algorihtm by Jackson et al.(2005). |
logH |
(Opt.) A Boolean algebra determine whether to report the log H matrix in DKK2015. Default is FALSE. |
logMD |
(Opt.) The log marginal likelihood function (which
is the log of D function in DKK2015). The function must
be in the form of |
See Manual.pdf in "data" folder.
If logH
is FALSE, the function returns the set of
estimated change-points by the index of the data, where
each index is the end point of a segment. If the result
is no change-points, the function returns NULL
.
If logH
is TRUE, then the function
returns a list with three components:
changePTs
is the set of estimated change-points,
log.H
is the log value for the H matrix used in the algorithm,
where , and
max.j
records the that maximizes the marginal likelihood in each step.
See the manual in data folder for more details.
Chao Du, Chu-Lan Michael Kao and S. C. Kou (2015), "Stepwise Signal Extraction via Marginal Likelihood". Forthcoming in Journal of American Statistical Association.
library(StepSignalMargiLike) n <- 5 data.x <- rnorm(n, 1, 1) data.x <- c(data.x, rnorm(n, 10,1)) data.x <- c(data.x, rnorm(n, 2,1)) data.x <- c(data.x, rnorm(n, 10,1)) data.x <- c(data.x, rnorm(n, 1,1)) prior <- prior.norm.A(data.x) max.segs <- 10 est.changepoints(data.x=data.x, model="normal", prior=prior) est.changepoints(data.x=data.x, model="normal", prior=prior, max.segs=max.segs) est.changepoints(data.x=data.x, model="normal", prior=prior, max.segs=max.segs,logH=TRUE)
library(StepSignalMargiLike) n <- 5 data.x <- rnorm(n, 1, 1) data.x <- c(data.x, rnorm(n, 10,1)) data.x <- c(data.x, rnorm(n, 2,1)) data.x <- c(data.x, rnorm(n, 10,1)) data.x <- c(data.x, rnorm(n, 1,1)) prior <- prior.norm.A(data.x) max.segs <- 10 est.changepoints(data.x=data.x, model="normal", prior=prior) est.changepoints(data.x=data.x, model="normal", prior=prior, max.segs=max.segs) est.changepoints(data.x=data.x, model="normal", prior=prior, max.segs=max.segs,logH=TRUE)
This function estimates the posterior mean for each
segments under the normal assumption with conjugate prior.
The variance is assumed to be drawn from an
inverse Gamma distribution with shape parameter
and scale parameter
, while mean is assumed
to be drawn from a normal distribution with mean
and variance
.
est.mean.norm(data.x, index.ChPT, prior)
est.mean.norm(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.
library(StepSignalMargiLike) n <- 5 data.x <- rnorm(n, 1, 1) data.x <- c(data.x, rnorm(n, 10,1)) data.x <- c(data.x, rnorm(n, 2,1)) data.x <- c(data.x, rnorm(n, 10,1)) data.x <- c(data.x, rnorm(n, 1,1)) prior <- prior.norm.A(data.x) index.ChPT <- c(n,2*n,3*n,4*n) est.mean.norm(data.x, index.ChPT, prior)
library(StepSignalMargiLike) n <- 5 data.x <- rnorm(n, 1, 1) data.x <- c(data.x, rnorm(n, 10,1)) data.x <- c(data.x, rnorm(n, 2,1)) data.x <- c(data.x, rnorm(n, 10,1)) data.x <- c(data.x, rnorm(n, 1,1)) prior <- prior.norm.A(data.x) index.ChPT <- c(n,2*n,3*n,4*n) est.mean.norm(data.x, index.ChPT, prior)
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
.
est.mean.pois(data.x, index.ChPT, prior)
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.
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)
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)
This function plots the data and the estimated stepwise signal given the estimated change points and means. The function only applies to one dimensional data.
PlotChangePoints(data.x, data.t, index.ChPT, est.mean, type.data, col.data, col.est, main.plot, sub.plot, xlab.plot, ylab.plot)
PlotChangePoints(data.x, data.t, index.ChPT, est.mean, type.data, col.data, col.est, main.plot, sub.plot, xlab.plot, ylab.plot)
data.x |
Observed data in vector form where each element represents a single observation. |
data.t |
The one-dimensional time or seqeuential labeling for the data. |
index.ChPT |
The set of the index of change points
in a vector. Must be in accending order. This could be
obtained by |
est.mean |
The estimated mean in each segments in a
vector. The length must be one plus the length of
|
type.data |
(Opt.) The line type for the data. Options are the same as in plot() argument. Default is "l". |
col.data |
(Opt.) The line color for the data. Options are the same as in plot() argument. Default is "red". |
col.est |
(Opt.) The line color for the estimated stepwise signal. Options are the same as in plot() arguent. Default is "blue". |
main.plot |
(Opt.) The overall title used in the plot, which is like the main in plot(). Default is NULL. |
sub.plot |
(Opt.) The sub title used in the plot, which is like the main in plot(). Default is NULL. |
xlab.plot |
(Opt.) The title for the x axis used in the plot, which is like the main in plot(). Default is "data.t". |
ylab.plot |
(Opt.) The title for the y axis used in the plot, which is like the main in plot(). Default is "data.x". |
See Manual.pdf in "data" folder.
Plot for the data and the estimated change-points. Note that this function only apply to one-dimensional observation.
library(StepSignalMargiLike) n <- 5 data.x <- rnorm(n, 1, 1) data.x <- c(data.x, rnorm(n, 10,1)) data.x <- c(data.x, rnorm(n, 2,1)) data.x <- c(data.x, rnorm(n, 10,1)) data.x <- c(data.x, rnorm(n, 1,1)) data.x <- matrix(data.x, 1) data.t <- 1:(5*n) index.ChPT <- c(n,2*n,3*n,4*n) est.mean <- c(1,10,2,10,2) PlotChangePoints(data.x, data.t, index.ChPT, est.mean) PlotChangePoints(data.x, data.t, index.ChPT, est.mean, type.data="p", col.data="green", col.est="black", main="Stepwise Signal Estimation", sub="Using Marginal Likelihood", xlab="time", ylab="value")
library(StepSignalMargiLike) n <- 5 data.x <- rnorm(n, 1, 1) data.x <- c(data.x, rnorm(n, 10,1)) data.x <- c(data.x, rnorm(n, 2,1)) data.x <- c(data.x, rnorm(n, 10,1)) data.x <- c(data.x, rnorm(n, 1,1)) data.x <- matrix(data.x, 1) data.t <- 1:(5*n) index.ChPT <- c(n,2*n,3*n,4*n) est.mean <- c(1,10,2,10,2) PlotChangePoints(data.x, data.t, index.ChPT, est.mean) PlotChangePoints(data.x, data.t, index.ChPT, est.mean, type.data="p", col.data="green", col.est="black", main="Stepwise Signal Estimation", sub="Using Marginal Likelihood", xlab="time", ylab="value")
This function computes the Norm-A prior proposed in Du, Kao
and Kou (2015), which is used under conjugate normal
assumption. The variance is assumed to be
drawn from an inverse Gamma distribution with shape
parameter
and scale parameter
,
while mean is assumed to be drawn from a normal
distribution with mean
and variance
.
prior.norm.A(data.x)
prior.norm.A(data.x)
data.x |
Observed data in vector form where each element represents a single observation. |
See Manual.pdf in "data" folder.
Vector for prior parameters in the order of ()
Chao Du, Chu-Lan Michael Kao and S. C. Kou (2015), "Stepwise Signal Extraction via Marginal Likelihood". Forthcoming in Journal of American Statistical Association.
library(StepSignalMargiLike) n <- 5 data.x <- rnorm(n, 1, 1) data.x <- c(data.x, rnorm(n, 10,1)) data.x <- c(data.x, rnorm(n, 2,1)) data.x <- c(data.x, rnorm(n, 10,1)) data.x <- c(data.x, rnorm(n, 1,1)) prior.norm.A(data.x)
library(StepSignalMargiLike) n <- 5 data.x <- rnorm(n, 1, 1) data.x <- c(data.x, rnorm(n, 10,1)) data.x <- c(data.x, rnorm(n, 2,1)) data.x <- c(data.x, rnorm(n, 10,1)) data.x <- c(data.x, rnorm(n, 1,1)) prior.norm.A(data.x)
This function computes the Norm-B prior proposed in Du, Kao
and Kou (2015), which is used under conjugate normal
assumption. The variance is assumed to be
drawn from an inverse Gamma distribution with shape
parameter
and scale parameter
,
while mean is assumed to be drawn from a normal
distribution with mean
and variance
.
prior.norm.B(data.x)
prior.norm.B(data.x)
data.x |
Observed data in vector form where each element represents a single observation. |
See Manual.pdf in "data" folder.
Vector for prior parameters in the order of ()
Chao Du, Chu-Lan Michael Kao and S. C. Kou (2015), "Stepwise Signal Extraction via Marginal Likelihood". Forthcoming in Journal of American Statistical Association.
library(StepSignalMargiLike) n <- 5 data.x <- rnorm(n, 1, 1) data.x <- c(data.x, rnorm(n, 10,1)) data.x <- c(data.x, rnorm(n, 2,1)) data.x <- c(data.x, rnorm(n, 10,1)) data.x <- c(data.x, rnorm(n, 1,1)) prior.norm.B(data.x)
library(StepSignalMargiLike) n <- 5 data.x <- rnorm(n, 1, 1) data.x <- c(data.x, rnorm(n, 10,1)) data.x <- c(data.x, rnorm(n, 2,1)) data.x <- c(data.x, rnorm(n, 10,1)) data.x <- c(data.x, rnorm(n, 1,1)) prior.norm.B(data.x)
This function computes the Norm-C prior proposed in Du, Kao
and Kou (2015), which is used under conjugate normal
assumption. The variance is assumed to be
drawn from an inverse Gamma distribution with shape
parameter
and scale parameter
,
while mean is assumed to be drawn from a normal
distribution with mean
and variance
.
prior.norm.C(data.x)
prior.norm.C(data.x)
data.x |
Observed data in vector form where each element represents a single observation. |
See Manual.pdf in "data" folder.
Vector for prior parameters in the order of ()
Chao Du, Chu-Lan Michael Kao and S. C. Kou (2015), "Stepwise Signal Extraction via Marginal Likelihood". Forthcoming in Journal of American Statistical Association.
library(StepSignalMargiLike) n <- 5 data.x <- rnorm(n, 1, 1) data.x <- c(data.x, rnorm(n, 10,1)) data.x <- c(data.x, rnorm(n, 2,1)) data.x <- c(data.x, rnorm(n, 10,1)) data.x <- c(data.x, rnorm(n, 1,1)) prior.norm.C(data.x)
library(StepSignalMargiLike) n <- 5 data.x <- rnorm(n, 1, 1) data.x <- c(data.x, rnorm(n, 10,1)) data.x <- c(data.x, rnorm(n, 2,1)) data.x <- c(data.x, rnorm(n, 10,1)) data.x <- c(data.x, rnorm(n, 1,1)) prior.norm.C(data.x)
This function computes the Pois prior proposed in Du, Kao
and Kou (2015), which is used 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
.
prior.pois(data.x)
prior.pois(data.x)
data.x |
Observed data in vector form where each element represents a single observation. |
See Manual.pdf in "data" folder.
Vector for prior parameters in the order of ()
Chao Du, Chu-Lan Michael Kao and S. C. Kou (2015), "Stepwise Signal Extraction via Marginal Likelihood". Forthcoming in Journal of American Statistical Association.
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)) prior.pois(data.x)
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)) prior.pois(data.x)
Supported C++ function used in function est.changepoints
.
StepSignalMargiLike_ChangePointAnalyzeNorm
StepSignalMargiLike_ChangePointAnalyzeNorm
n <- 5 max.segs <- 5 data.x <- rnorm(n, 1, 1) data.x <- c(data.x, rnorm(n, 10,1)) data.x <- c(data.x, rnorm(n, 2,1)) data.x <- c(data.x, rnorm(n, 10,1)) data.x <- c(data.x, rnorm(n, 1,1)) data.t <- 1:(5*n) prior <- prior.norm.A(data.x) ChangePointAnalyzeNorm(data.x, n, max.segs, prior)
n <- 5 max.segs <- 5 data.x <- rnorm(n, 1, 1) data.x <- c(data.x, rnorm(n, 10,1)) data.x <- c(data.x, rnorm(n, 2,1)) data.x <- c(data.x, rnorm(n, 10,1)) data.x <- c(data.x, rnorm(n, 1,1)) data.t <- 1:(5*n) prior <- prior.norm.A(data.x) ChangePointAnalyzeNorm(data.x, n, max.segs, prior)
Supported C++ function used in function est.changepoints
.
StepSignalMargiLike_ChangePointAnalyzeNormUnRes
StepSignalMargiLike_ChangePointAnalyzeNormUnRes
n <- 5 data.x <- rnorm(n, 1, 1) data.x <- c(data.x, rnorm(n, 10,1)) data.x <- c(data.x, rnorm(n, 2,1)) data.x <- c(data.x, rnorm(n, 10,1)) data.x <- c(data.x, rnorm(n, 1,1)) data.t <- 1:(5*n) prior <- prior.norm.A(data.x) ChangePointAnalyzeNormUnRes(data.x, n, prior)
n <- 5 data.x <- rnorm(n, 1, 1) data.x <- c(data.x, rnorm(n, 10,1)) data.x <- c(data.x, rnorm(n, 2,1)) data.x <- c(data.x, rnorm(n, 10,1)) data.x <- c(data.x, rnorm(n, 1,1)) data.t <- 1:(5*n) prior <- prior.norm.A(data.x) ChangePointAnalyzeNormUnRes(data.x, n, prior)
Supported C++ function used in function est.changepoints
.
StepSignalMargiLike_ChangePointAnalyzePoiss
StepSignalMargiLike_ChangePointAnalyzePoiss
n <- 20 max.segs <- 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)) prior <- prior.pois(data.x) ChangePointAnalyzePoiss(data.x, n, max.segs, prior)
n <- 20 max.segs <- 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)) prior <- prior.pois(data.x) ChangePointAnalyzePoiss(data.x, n, max.segs, prior)
Supported C++ function used in function est.changepoints
.
StepSignalMargiLike_ChangePointAnalyzePoissUnRes
StepSignalMargiLike_ChangePointAnalyzePoissUnRes
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)) prior <- prior.pois(data.x) ChangePointAnalyzePoissUnRes(data.x, n, prior)
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)) prior <- prior.pois(data.x) ChangePointAnalyzePoissUnRes(data.x, n, prior)