tuneBSmultinonpar {changepoints}R Documentation

A function to compute change points based on the multivariate nonparametic method with tuning parameter selected by FDR control.

Description

A function to compute change points based on the multivariate nonparametic method with tuning parameter selected by FDR control.

Usage

tuneBSmultinonpar(BS_object, Y)

Arguments

BS_object

A "BS" object produced by WBS.multi.nonpar.

Y

A numeric matrix of observations with with horizontal axis being time, and vertical axis being dimension.

Value

A vector of estimated change points.

Author(s)

Oscar Hernan Madrid Padilla & Haotian Xu

References

Padilla, Yu, Wang and Rinaldo (2019) <arxiv:1910.13289>.

See Also

WBS.multi.nonpar.

Examples

n = 70
v = c(floor(n/3), 2*floor(n/3)) # location of change points
p = 4
Y = matrix(0, p, n) # matrix for data
mu0 = rep(0, p) # mean of the data
mu1 = rep(0, p)
mu1[1:floor(p/2)] = 2
Sigma0 = diag(p) #Covariance matrices of the data
Sigma1 = diag(p)*2
# Generate data
for(t in 1:n){
  if(t < v[1] || t > v[2]){
     Y[,t] = MASS::mvrnorm(n = 1, mu0, Sigma0)
  }
  if(t >= v[1] && t < v[2]){
     Y[,t] = MASS::mvrnorm(n = 1, mu1, Sigma1)
  }
}## close for generate data
M = 8
intervals = WBS.intervals(M = M, lower = 1, upper = ncol(Y)) #Random intervals
K_max = 30
h = 5*(K_max*log(n)/n)^{1/p} # bandwith
temp = WBS.multi.nonpar(Y, Y, 1, ncol(Y), intervals$Alpha, intervals$Beta, h, delta = 10)
S = tuneBSmultinonpar(temp, Y)

[Package changepoints version 1.1.0 Index]