getLogLik: Get the log-likelihood

View source: R/Empirical_P_Values.R

getLogLikR Documentation

Get the log-likelihood

Description

Takes in a vector of observations and a vector of changepoints. It returns the log-likelihood assuming that each segment between two changepoints follows a normal distribution. Optionally, the means, standard deviations, and lengths of each segment can be provided. If not provided, they are calculated.

Usage

getLogLik(series, changepoints, means=NA, sds=NA, segLengths=NA)

Arguments

series

A vector of observations on which to run changepoint analysis. This vector must not contain any missing values.

changepoints

A vector indicating the indices at which there are changepoints. A changepoint is located immediately prior to a shift in the series.

means

A optional vector where each entry corresponds to the mean of a segment.

sds

A optional vector where each entry corresponds to the standard deviation of a segment.

segLengths

A optional vector where each entry corresponds to the length of a segment.

Value

Returns the log likelihood (a numeric value).

Author(s)

Matthew Quinn


matthewquinn1/changepointSelect documentation built on July 25, 2022, 7:12 p.m.