Learn R Programming

changepoint (version 0.3)

likelihood: Generic Function - likelihood

Description

Generic function to calculate the likelihood

Usage

likelihood(object)

Arguments

object
Depending on the class of object depends on the method used to calculate the likelihood (and if one exists)

Value

  • Depends on the class of object, see individual methods

Details

Generic Function to calculate the likelihood.

See Also

likelihood-methods, cpt.mean,cpt.var,cpt.meanvar

Examples

Run this code
set.seed(1)
x=c(rnorm(50,0,1),rnorm(50,0,10),rnorm(50,0,5),rnorm(50,0,1))
out=cpt.var(x,penalty="Manual",value="2*log(n)",method="BinSeg",Q=5)
likelihood(out) # returns the raw likelihood (783.9144) and the likelihood + penalty (805.1076)

Run the code above in your browser using DataLab