View source: R/plot_summary_print_Multi.R
plot.SNSeg_Multi | R Documentation |
Plotting method for S3 objects of class SNSeg_Multi
## S3 method for class 'SNSeg_Multi'
plot(x, cpts.col = "red", ...)
x |
a |
cpts.col |
a specification for the color of the vertical lines at the change point estimators, see par |
... |
additional graphical arguments, see plot and abline |
The location of each change point estimator is plotted as a vertical line against the input time series.
# Please run this function before simulation
exchange_cor_matrix <- function(d, rho){
tmp <- matrix(rho, d, d)
diag(tmp) <- 1
return(tmp)
}
# simulation of multivariate time series
library(mvtnorm)
set.seed(10)
d <- 5
n <- 600
nocp <- 5
cp_sets <- round(seq(0, nocp+1 ,1)/(nocp+1)*n)
mean_shift <- rep(c(0,2),100)[1:(length(cp_sets)-1)]/sqrt(d)
rho_sets <- 0.2
sigma_cross <- list(exchange_cor_matrix(d,0))
ts <- MAR_MTS_Covariance(n, 2, rho_sets, cp_sets = c(0,n), sigma_cross)
ts <- ts[1][[1]]
# Test for the change in multivariate means
# grid_size defined
result <- SNSeg_Multi(ts, paras_to_test = "mean", confidence = 0.99,
grid_size_scale = 0.05, grid_size = 45)
# plot method
plot(result)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.