MyNixOS website logo
Description

Asymptotic Distribution-Free Change-Point Detection via a New Ranking Scheme (RING).

Rank-based, asymptotic distribution-free change-point detection for modern (high-dimensional, non-Euclidean) data, based on the graph-induced ranking scheme of Zhou and Chen (2025) <doi:10.1109/TIT.2025.3575858>. Given a rank matrix built from a pairwise similarity, the method scans for a single change-point or a changed interval using three statistics (weighted 'WR', max-type 'MR', and generalized 'TR') and returns analytic distribution-free p-value approximations (with an optional skewness correction) as well as optional permutation p-values.

ringSeg

Rank-based, asymptotic distribution-free change-point detection (the RING method, Zhou & Chen 2025, IEEE TIT). Detects a single change-point or a changed interval in a sequence of (possibly high-dimensional / non-Euclidean) observations, with analytic distribution-free p-values (no permutation needed) plus an optional skewness correction and optional permutation p-values.

The method ranks each observation's neighbours within a sparse k-nearest-neighbour graph and reduces the scan to three rank statistics -- weighted (WR), max-type (MR), and generalized (TR) -- whose null distribution is asymptotically distribution-free, so p-values are available in closed form. Inputs may be a data matrix, a distance matrix, or a precomputed rank matrix; the data need not be Euclidean.

Install

# from the built tarball
install.packages("ringSeg_0.1.0.tar.gz", repos = NULL, type = "source")
# or from source dir:  R CMD INSTALL ringSeg

Use

library(ringSeg)

set.seed(1)
n <- 200; d <- 10; tau <- 100
X <- matrix(rnorm(n * d), n, d)
X[(tau + 1):n, ] <- X[(tau + 1):n, ] * 1.6        # a dispersion change at t = 100

res <- ring_cpd(X, skew.corr = TRUE)              # data in (rows = time order)
res$scanZ$TR$tau        # estimated change-point
res$pval.appr$TR        # generalized-statistic analytic p-value
res$pval.appr$WR.cor    # skewness-corrected weighted-statistic p-value

By default ring_cpd() builds RING's row-rank k-nearest-neighbour graph (k = round(n^0.65)) -- the sparse "new ranking scheme" the method is built on. It also accepts a distance matrix (is.distance = TRUE) or a precomputed rank matrix (is.rank = TRUE). For full control, build the graph with ring_graph() and call rcpd():

D   <- as.matrix(dist(X))
R   <- ring_graph(D, k = 13)                   # RING k-NN rank graph
res <- rcpd(R, skew.corr = TRUE, B = 0)        # B > 0 adds permutation p-values

Functions

The package exposes four functions, layered from high-level (data in) to low-level:

FunctionInputDoes
ring_cpd(x, ...)data matrix (rows = time order), or a distance / rank matrixTop-level wrapper. Builds the RING graph from x (via ring_graph) and runs the scan (via rcpd). Start here.
rcpd(R, ...)an n x n rank/weight matrix RCore engine. Scans for a change-point / interval, returns the WR/MR/TR statistics, the estimated change-point(s), analytic p-values, and (if B > 0) permutation p-values.
ring_graph(D, k)an n x n distance matrix DBuilds RING's sparse row-rank k-NN rank graph -- the "new ranking scheme" rcpd operates on. Returns R.
Rise_Rank(S, method)an n x n similarity matrix SLow-level utility: ranks the entries of S ("row" = per-row ranks, used by ring_graph; "overall" = all pairs jointly). Rarely called directly.

Relationship: ring_cpd(x) is essentially rcpd(ring_graph(as.matrix(dist(x)))). Use ring_cpd for "data in, result out"; drop to ring_graph + rcpd when you want full control over the similarity / graph (e.g. non-Euclidean data, a custom kernel, or reusing one R).

Statistics

  • WR -- weighted rank statistic (Z_w)
  • MR -- max-type, max(|Z_diff|, Z_w)
  • TR -- generalized omnibus, Z_w^2 + Z_diff^2 (recommended default)

Input handling (warn vs. error)

Inputs are checked with a consistent policy: coercible quirks are accepted with a warning, genuinely broken inputs are a hard error.

InputBehaviour
D (distance) with negative entrieswarning, proceeds -- S = max(D) - D still ranks, so a general (dis)similarity is allowed
n0 / n1 / knon-integer but in rangewarning, rounded to the nearest integer
Rnot symmetricwarning, symmetrized as (R + t(R)) / 2
n0 / n1 outside [0, n], or k outside 1..n-1error
D, x, or R with NA / NaN / Inferror (not coercible)
R not square / negative weights / non-zero diagonalerror (invalid rank/weight matrix)
fewer than 4 observationserror (the scan statistic is undefined)
B not a single non-negative integer; pval.appr / skew.corr not a single TRUE/FALSEerror

Diagnostic notes (e.g. the scan-range adjustment) are emitted via message(), so they can be silenced with suppressMessages().

Notes on calibration

The skewness-corrected analytic p-value (*.cor, the default) is well-calibrated at finite n; the uncorrected Gaussian/field approximation can be mildly anti-conservative for small n. For small samples, B > 0 (permutation) is always available as an exact alternative. Permutation p-values use the add-one estimator (#{perm >= obs} + 1) / (B + 1), so they are always strictly positive.

Maintainer / license

Maintainer Hao Chen [email protected]. License GPL (>= 2), matching the sibling packages gSeg and kerSeg. Citation (citation("ringSeg")): Zhou, D. & Chen, H. (2025), Asymptotic Distribution-Free Change-Point Detection for Modern Data Based on a New Ranking Scheme, IEEE Transactions on Information Theory, 71(8), 6183-6197. doi:10.1109/TIT.2025.3575858.

Metadata

Version

0.1.0

License

Unknown

Platforms (79)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    uefi
    wasip1
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-uefi
  • aarch64-windows
  • aarch64_be-none
  • arc-linux
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-linux
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • sh4-linux
  • vc4-none
  • wasm32-wasip1
  • wasm64-wasip1
  • x86_64-cygwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-uefi
  • x86_64-windows