SNSeg: An R Package for Time Series Segmentation via Self-Normalization
IntroductionTime series segmentation, also known as change-point estimation in time series, has become increasingly popular in various fields such as statistics, bioinformatics, climate science, economics, finance, signal processing, epidemiology, among many others.As a result, numerous methods have been proposed to address different types of change-point estimation problems under various settings.This in turn leads to the development of many R packages for their implementation.Here, we list some commonly used and influential packages for change-point analysis in the R programming language.The package strucchange (Zeileis et al., 2002) employs algorithms proposed by Zeileis et al. (2003) to identify structural changes in linear regression models.The package changepoint (Killick and Eckley, 2014) provides numerous methods for estimating change-points in a univariate time series, containing the Binary Segmentation (BS) and the pruned exact linear time (PELT) algorithm as described in Killick et al. (2012), and the segment neighbourhoods algorithm in Auger and Lawrence (1989).The package mosum (Meier et al., 2021) executes the moving sum (MOSUM) procedure introduced by Eichinger and Kirch (2018) for univariate time series.It can implement MOSUM with a single bandwidth parameter and also allows multiple bandwidths via either bottom-up merging or localized pruning.The package cpss (Wang and Zou, 2023) focuses on change-point estimation in various generalized linear models utilizing the sample-split strategy proposed by Zou et al. (2020).We note that there are also packages targeting nonparametric distributional changes, e.g. the package ecp (James and Matteson, 2014) and cpm (Ross, 2015).However, the aforementioned methods, as well as their implementation packages, are subject to certain limitations when applied to change-point estimation in multivariate time series.First, most packages only provide functions to detect specific types of changes (e.g.mean or variance).Although it may be possible to modify these functions to cover other types of changes (e.g.quantiles), such a generalization is usually not easy and requires non-trivial effort.This means that for the same dataset, different methods or substantial modifications to the existing codes may be required for estimating different types of changes, which may incur inconvenience of implementation for practitioners.Second, many packages implement methods that assume temporal independence among data, which may not be realistic in practice, and thus may suffer from issues such as false positive detections.Recently, Zhao et al. ( 2022) have developed a new framework called self-normalization based change-point estimation (SNCP) to overcome the above limitations.The most appealing feature of SNCP is its versatility as it allows for change-point estimation in a broad class of parameters (such as mean, variance, correlation, quantile and their combinations) in a unified fashion.The basic idea of SNCP is to augment the conventional cumulative sum (CUSUM) statistics with the technique called self-normalization (SN).SN is originally introduced by Shao (2010) for confidence interval construction of a general parameter in the stationarity time series setting, and is later extended to change-point testing by Shao and Zhang (2010).It can bypass the issue of bandwidth selection in the consistent long-run variance estimation.See Shao (2015) for a review.SNCP is fully nonparametric, robust to temporal dependence and applicable universally for various parameters of interest for a multivariate time series.Furthermore, based on a series of carefully designed nested local-windows, SNCP can isolate each true change-point adaptively and achieves the goal of multiple change-point estimation with respectable detection power and estimation accuracy.In this paper, we introduce the R package SNSeg (Sun et al., 2023), which implements the SNCP framework in Zhao et al. (2022) for univariate and multivariate time series segmentation.This is achieved by the functions SNSeg_Uni() and SNSeg_Multi(), respectively.Another contribution of this paper is to extend the SNCP framework to change-point estimation in the mean vector of a high-dimensional time series.Since SNCP is only applicable to fixed-dimensional time series, a new procedure based on U-statistics (Wang et al., 2022), termed as SNHD, is proposed by modifying the original SNCP in Zhao et al. (2022).The implementation of SNHD is available through the function SNSeg_HD().Graphical options are also allowed for plotting the estimated change-points and associated test statistics.The rest of the paper is organized as follows.We first provide the background of SN based statistics and the SNCP/SNHD procedures for change-point estimation in Section 2.2.In Section
Authors
- Feiyu Jiang (ORCID: https://orcid.org/0000-0002-6243-6200)
- Xiaofeng Shao (ORCID: https://orcid.org/0000-0001-5822-8209)
- Zifeng Zhao
- Shubo Sun (ORCID: https://orcid.org/0000-0003-3739-8588)
Institutions
- University of Notre Dame (US)
- University of Miami (US)
- University of Illinois Urbana-Champaign (US)
- Fudan University (CN)
Publication Details
- Journal
- The R Journal
- Published
- 2025-05-20
- DOI
- https://doi.org/10.32614/rj-2024-029
- Primary Topic
- Time Series Analysis and Forecasting
- Type
- article
- Field-Weighted Citation Impact
- 0.00