MA1.data: Most recent changepoints

Description Usage Arguments Value Examples

View source: R/mrc(MA).R

Description

Detecting most recent changepoints using censored data generated from MA model.

Usage

1
2
MA1.data(n = 500, N = 100, K = 5, eps = 1, rho = 0.6, mu = 0,
  siga = 1, rates = c(NA, 0.2), Mrate = 0)

Arguments

n

length of series, default 500. The size of series(n) should be greater than 200.

N

number of series, default 100.

K

number of most recent changepoints, default 5.

eps

size of the mean change at the most recent changepoint.

rho

ma coefficients

mu

mean

siga

standard deviation of innovations

rates

either a vector of length 2 or a matrix with n rows and 2 columns. In the vector case, the first element indicates the left-censor rate and the second element indicates the right-censor rate. Set to NA if there is no censoring. Interval censored data corresponds to setting both a left-censor rate and right-censor rate. The default setting indicates a right-censor rate 0.2 with no left censoring. The vector case handles single censoring and the matrix case is for multiple censor points. In this case each column indicates the corresponding censoring for each observation.

Mrate

fraction of missing values. Default is 0

Value

an object of class 'censored' which is a list with four elements. First element, 'data', is the censored time series. Second element, 'mrc', indicates the most recent changepoints. Third element, 'series.mrc' indicates which series is affecting from the most recent changepoint. Fourth element, 'series.chpts' indicates the changepoints in each series.

Examples

1
2
3
4
5
6
7
#Default example
library(cpcens)
ans<-MA1.data()
#example (right censoring)
# The size of series(n) should be greater than 200.
ans<-MA1.data ( n=500 , N = 100 , K = 5 , eps = 1 , rho=0.2,
mu = 0,  siga = 1, rates = c(NA,0.4), Mrate=0 )

cpcens documentation built on Aug. 2, 2019, 5:05 p.m.

Related to MA1.data in cpcens...