BinSearch.BIC: Example function: Calculating BIC for AR(1) model

View source: R/BinSearch.BIC.R

BinSearch.BICR Documentation

Example function: Calculating BIC for AR(1) model

Description

The example objective function for changepoint search via Bayesian Information Criterion (BIC) for simple AR(1) model from Shi et al. (2022). The model is expressed as X_{t}=\kappa_{t}+\epsilon_{t}, where \epsilon_{t} follows a stationary AR(1) process, and \kappa_{t} denotes the regimen mean.

Usage

BinSearch.BIC(chromosome, plen = 0, Xt)

Arguments

chromosome

The chromosome consists of the number of changepoints, their locations, and a value of time series length plus 1 (N+1) indicating the end of the chromosome.

plen

The number of model order parameters that need to be selected. Since we don't need model order selection in this example, plen equals to 0.

Xt

The simulated AR(1) time series from ts.sim function.

Value

The BIC value of the objective function.

References

Shi, X., Gallagher, C., Lund, R., & Killick, R. (2022). A comparison of single and multiple changepoint techniques for time series data. Computational Statistics & Data Analysis, 170, 107433.

Examples

Ts = 1000
betaT = c(0.5) # intercept
XMatT = matrix(1, nrow=Ts, ncol=1)
colnames(XMatT) = "intercept"
sigmaT = 1
phiT = c(0.5)
thetaT = NULL
DeltaT = c(2, -2)
Cp.prop = c(1/4, 3/4)
CpLocT = floor(Ts*Cp.prop)

myts = ts.sim(beta=betaT, XMat=XMatT, sigma=sigmaT, phi=phiT, theta=thetaT,
              Delta=DeltaT, CpLoc=CpLocT, seed=1234)

# candidate changepoint configuration
chromosome = c(2, 250, 750, 1001)
BinSearch.BIC(chromosome, Xt=myts)

changepointGA documentation built on April 4, 2025, 4:39 a.m.