Learn R Programming

cpcens (version 0.1.0)

indAR: Most recent changepoints from ind method using censored AR timeseries.

Description

Detecting most recent changepoints from ind method (analyzes all the series independently in the panel data and in each given series estimate the most recent changepoint) after generating censored data from AR model. We use PELT for segmenting a time series into changing means, assumes normally distributed observations with changing mean but constant variance.

Usage

indAR(data, pen = 0)

Arguments

data

a censored data matrix obtained from AR1.data .

pen

default 2*log(n). If pen is equal to zero, penalty term will be equal to 2*log(n).

Value

indicates the most recent changepoint in each series .

See Also

AR1.data

Examples

Run this code
# NOT RUN {
#Default example
library(cpcens)
sim=AR1.data()
data=sim$data
ans = indAR(data,pen)
#example(right censoring)
#The length of series(n) should be greater than 200.
sim=AR1.data(n = 500, N = 100, K = 5, eps = 1,
rho = 0.6, mu = 0, siga = 1, rates = c(NA, 0.2), Mrate = 0)
data=sim$data
ans = indAR(data,pen=0)
# }

Run the code above in your browser using DataLab