NetCPD {frechet}R Documentation

Fréchet Change Point Detection for Networks

Description

Fréchet change point detection for graph Laplacian matrices, covariance matrices, or correlation matrices with respect to the Frobenius distance.

Usage

NetCPD(Ly = NULL, optns = list())

Arguments

Ly

A list (length n) of m by m matrices or a m by m by n array where Ly[, , i] contains an m by m matrix, which can be either graph Laplacian matrices or covariance matrices or correlation matrices.

optns

A list of control parameters specified by list(name = value). See 'Details'.

Details

Available control options are:

cutOff

A scalar between 0 and 1 indicating the interval, i.e., [cutOff, 1 - cutOff], in which candidate change points lie.

Q

A scalar representing the number of Monte Carlo simulations to run while approximating the critical value (stardized Brownian bridge). Default is 1000.

boot

Logical, also compute bootstrap p-value if TRUE. Default is FALSE.

R

The number of bootstrap replicates. Only used when boot is TRUE. Default is 1000.

Value

A NetCPD object — a list containing the following fields:

tau

a scalar holding the estimated change point.

pvalAsy

A scalar holding the asymptotic p-value.

pvalBoot

A scalar holding the bootstrap p-value. Returned if optns$boot is TRUE.

optns

The control options used.

References

Examples


set.seed(1)
n1 <- 100
n2 <- 100
gamma1 <- 2
gamma2 <- 3
Y1 <- lapply(1:n1, function(i) {
  igraph::laplacian_matrix(igraph::sample_pa(n = 10, power = gamma1, 
                                             directed = FALSE), 
                           sparse = FALSE)
})
Y2 <- lapply(1:n2, function(i) {
  igraph::laplacian_matrix(igraph::sample_pa(n = 10, power = gamma2, 
                                             directed = FALSE), 
                           sparse = FALSE)
})
Ly <- c(Y1, Y2)
res <- NetCPD(Ly, optns = list(boot = TRUE))
res$tau # returns the estimated change point
res$pvalAsy # returns asymptotic pvalue
res$pvalBoot # returns bootstrap pvalue


[Package frechet version 0.3.0 Index]