Learn R Programming

InspectChangepoint (version 1.2)

single.change: Generating high-dimensional time series with exactly one change in the mean structure

Description

The data matrix is generated via X = mu + W, where mu is the mean structure matrix that captures the changepoint location and sparsity structure, and W is a random noise matrix.

Usage

single.change(n, p, k, z, vartheta, sigma = 1, shape = 3, noise = 0, corr = 0)

Arguments

n

Time length of the observation

p

Dimension of the multivariate time series

k

Number of coordinates that undergo a change

z

Changepoint location, a number between 1 and n-1.

vartheta

The root mean squared change magnitude in coordinates that undergo a change

sigma

noise level, see noise for more details.

shape

How the signal strength is distributed across signal coordinates. When shape = 0, all signal coordinates are changed by the same amount; when shape = 1, their signal strength are proportional to 1, sqrt(2), ..., sqrt(k); when shape = 2, they are proportional to 1, 2, ..., k; when shape = 3, they are proportional to 1, 1/sqrt(2), ..., 1/sqrt(k).

noise

Noise structure of the multivarite time series. For noise = 0, 0.5, 1, columns of W have independent multivariate normal distribution with covariance matrix Sigma. When noise = 0, Sigma = sigma^2 * I_p; when noise = 0.5, noise has local dependence structure given by Sigma_i,j = sigma*corr^|i-j|; when noise = 1, noise has global dependence structure given by matrix(corr,p,p)+diag(p)*(1-corr))) * sigma. When noise = 2, rows of the W are independent and each having an AR(1) structure given by W_j,t = W_j,t-1 * sqrt(corr) + rnorm(sd = sigma) * sqrt(1-corr). For noise = 3, 4, entries of W have i.i.d. uniform distribution and exponential distribution respectively, each centred and rescaled to have zero mean and variance sigma^2.

corr

Used to specify correlation structure in the noise. See noise for more details.

Value

An S3 object of the class 'hdchangeseq' is returned.

  • x - The generated data matrix

  • mu - The mean structure of the data matrix

See Also

plot.hdchangeseq

Examples

Run this code
# NOT RUN {
n <- 2000; p <- 100; k <- 10; z <- 800; vartheta <- 1; sigma <- 1
shape <- 3; noise <- 0; corr <- 0
obj <- single.change(n,p,k,z,vartheta,sigma, shape, noise, corr)
plot(obj, noise = TRUE)
# }

Run the code above in your browser using DataLab