agraph: Segmentation using graph structure

View source: R/main.R

agraphR Documentation

Segmentation using graph structure

Description

These functions provide a clustering of a signal on graph into a piecewise constant signal on graph. Given a graph and a signal gamma assigning a value to each node, it returns another signal which is constant over subgraphs where gamma has close to equal value. See references.

Only parameters gamma and graph need be provided. The other parameters concern the internals of the estimating procedure and usually do not need to be changed. agraph is the general-purpose function. agraph_prec does the same thing as agraph in the case where gamma as a covariance structure. It is provided as the precision matrix prec, which has to be a sparse matrix (Matrix::sparseMatrix) for fast computation. See Goepp and van de Kassteele (2021).

Usage

agraph(
  gamma,
  graph,
  lambda = 10^seq(-4, 4, length.out = 50),
  weights = NULL,
  shrinkage = TRUE,
  delta = 1e-10,
  tol = 1e-08,
  thresh = 0.01,
  itermax = 50000
)

agraph_prec(
  gamma,
  graph,
  prec,
  lambda = 10^seq(-4, 4, length.out = 50),
  weights = NULL,
  shrinkage = TRUE,
  delta = 1e-10,
  tol = 1e-08,
  thresh = 0.01,
  itermax = 10000
)

Arguments

gamma

input vector to regularize

graph

an igraph object (from package igraph) giving the regularization structure

lambda

regularizing constant

weights

weights for gamma. Default value is one.

shrinkage

Boolean, defaults TRUE. Whether to return the adaptive ridge estimate as output. If FALSE, the adaptive ridge is used to define a segmentation into zones, and the signal is estimated on each zone using non-penalized estimation.

delta

Computational constant in the adaptive ridge reweighting formula.

tol

Tolerance to test for convergence of the adaptive ridge

thresh

Thresholding constant used to fuse two adjacent regions with close value of gamma.

itermax

Total number of iterations. Default value is 10000. Setting a low value can make the procedure return NULL entries for some values of lambda.

prec

precision matrix (inverse of the variance-covariance matrix). Has to be a sparse matrix for efficiency.

Value

A list with the following elements:

  • result: matrix whose rows are the segmented output of input signal gamma, for each value of lambda

  • bic, gcv, and aic: vectors of length length(lambda), giving the BIC, GCV, and AIC criteria for each value of lambda. See references below.

  • model_dim, nll: vectors of length length(lambda), giving the model dimension and negative log-likelihood for each value of lambda. See reference below for the definition of these terms.

References

Schwarz G. (1978) Estimating the Dimension of a Model. Ann. Statist. 6 (2) 461 - 464, March, 1978. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1214/aos/1176344136")}

Akaike H. (1974) A new look at the statistical model identification, in IEEE Transactions on Automatic Control, vol. 19, no. 6, pp. 716-723, December 1974 \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1109/TAC.1974.1100705")}

Hastie T., Friedman J., and Tibshirani R. (2009) The elements of statistical learning: data mining, inference, and prediction (Vol. 2, pp. 1-758). New York: Springer \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1007/978-0-387-21606-5")}

Goepp V. and van de Kassteele J. (2021) Graph-Based Spatial Segmentation of Health-Related Areal Data, arxiv preprint. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.48550/arXiv.2206.06752")}

See Also

flsa_graph()


goepp/graphseg documentation built on Nov. 23, 2023, 9:29 a.m.