Learn R Programming

InspectChangepoint (version 1.2)

cusum.transform: CUSUM transformation

Description

Performing CUSUM transformation to the input matrix of multivariate time series. If the input is a vector, it is treated as a matrix of one row.

Usage

cusum.transform(x)

Arguments

x

input matrix

Value

The transformed matrix is returned. Note that the returned matrix has the same number of rows but one fewer columns compared with the input matrix.

Details

For any integers p and n, the CUSUM transformation \(T_{p,n}: R^{p\times n}\to R^{p\times (n-1)}\) is defined by $$ [T_{p,n}(M)]_{j,t} := \sqrt{t(n-t)/n}\biggl(\frac{1}{n-t}\sum_{r=t+1}^n M_{j,r} - \frac{1}{t}\sum_{r=1}^t M_{j,r}\biggr). $$

Examples

Run this code
# NOT RUN {
x <- matrix(rnorm(20),4,5)
cusum.transform(x)
# }

Run the code above in your browser using DataLab