logLik.not {not}R Documentation

Extract likelihood from a 'not' object

Description

Calculates the Gaussian log-likelihood for the signal estimated using predict.not with the change-points at cpt. The type of the signal depends on on the value of contrast that has been passed to not (see predict.not).

Usage

## S3 method for class 'not'
logLik(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.

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")
# *** log-likelihood for the model with the change-point estimated  via 'not'
logLik(w)
# *** log-likelihood for the model with the change-point at 100
logLik(w, cpt=100)

[Package not version 1.5 Index]