predict.not {not}R Documentation

Estimate signal for a 'not' object.

Description

Estimates signal in object$x with change-points at cpt. The type of the signal depends on on the value of contrast that has been passed to not (see details below).

Usage

## S3 method for class 'not'
predict(object, cpt, ...)

Arguments

object

An object of class 'not', returned by not.

cpt

An integer vector with locations of the change-points. If missing, the features is called internally to extract the change-points from object.

...

Further parameters that can be passed to predict.not and features.

Details

The data points provided in object$x are assumed to follow

Y_{t} = f_{t}+\sigma_{t}\varepsilon_{t},

for t=1,\ldots,n, where n is the number of observations in object$x, the signal f_{t} and the standard deviation \sigma_{t} are non-stochastic with change-points at locations given in cpt and \varepsilon_{t} is a white-noise. Denote by \tau_{1}, \ldots, \tau_{q} the elements in cpt and set \tau_{0}=0 and \tau_{q+1}=T. Depending on the value of contrast that has been passed to not to construct object, the returned value is calculated as follows.

Value

A vector wit the estimated signal or a two-column matrix with the estimated estimated signal and standard deviation if contrast="pcwsConstMeanVar" was used to construct object.

See Also

not

Examples

# **** Piecewisce-constant mean with Gaussian noise.
x <- c(rep(0, 100), rep(1,100)) + rnorm(100)
# *** identify potential locations of the change-points
w <- not(x, contrast = "pcwsConstMean")
# *** when 'cpt' is omitted, 'features' function is used internally 
# to choose change-points locations
signal.est <- predict(w)
# *** estimate the signal specifying the location of the change-point
signal.est.known.cpt <- predict(w, cpt=100)
# *** pass arguments of the 'features' function through 'predict'.
signal.est.aic <- predict(w, penalty.type="aic")

# **** Piecewisce-constant mean and variance with Gaussian noise.
x <- c(rep(0, 100), rep(1,100)) + c(rep(2, 100), rep(1,100)) * rnorm(100)
# *** identify potential locations of the change-points
w <- not(x, contrast = "pcwsConstMeanVar")
# *** here signal is two-dimensional
signal.est <- predict(w)

[Package not version 1.5 Index]