complete_Gamma: Completion of Gamma matrices

View source: R/matrix_completions_main.R

complete_GammaR Documentation

Completion of Gamma matrices

Description

Given a graph and a (partial) variogram matrix Gamma, returns a full variogram matrix that agrees with Gamma in entries corresponding to edges of graph and whose corresponding precision matrix, obtained by Gamma2Theta(), has zeros in entries corresponding to non-edges of graph. For results on the existence and uniqueness of this completion, see \insertCitehen2022;textualgraphicalExtremes.

Usage

complete_Gamma(Gamma, graph = NULL, ...)

Arguments

Gamma

Numeric \dxd variogram matrix.

graph

NULL or igraph::graph object. If NULL, the graph is implied by non-edge entries in Gamma being NA. Must be connected, undirected.

...

Further arguments passed to complete_Gamma_general_split() if graph is not decomposable

Details

If graph is decomposable, Gamma only needs to be specified on the edges of the graph, other entries are ignored. If graph is not decomposable, the graphical completion algorithm requires a fully specified (but non-graphical) variogram matrix Gamma to begin with. If necessary, this initial completion is computed using edmcr::npf().

Value

Completed \dxd variogram matrix.

References

\insertAllCited

See Also

Gamma2Theta()

Other matrix completion related topics: complete_Gamma_decomposable(), complete_Gamma_general_demo(), complete_Gamma_general_split(), complete_Gamma_general()

Examples

## Block graph:
Gamma <- rbind(
  c(0, .5, NA, NA),
  c(.5, 0, 1, 1.5),
  c(NA, 1, 0, .8),
  c(NA, 1.5, .8, 0)
)

complete_Gamma(Gamma)

## Alternative representation of the same completion problem:
my_graph <- igraph::graph_from_adjacency_matrix(rbind(
  c(0, 1, 0, 0),
  c(1, 0, 1, 1),
  c(0, 1, 0, 1),
  c(0, 1, 1, 0)
), mode = "undirected")
Gamma_vec <- c(.5, 1, 1.5, .8)
complete_Gamma(Gamma_vec, my_graph)

## Decomposable graph:
G <- rbind(
c(0, 5, 7, 6, NA),
c(5, 0, 14, 15, NA),
c(7, 14, 0, 5, 5),
c(6, 15, 5, 0, 6),
c(NA, NA, 5, 6, 0)
)

complete_Gamma(G)

## Non-decomposable graph:
G <- rbind(
c(0, 5, 7, 6, 6),
c(5, 0, 14, 15, 13),
c(7, 14, 0, 5, 5),
c(6, 15, 5, 0, 6),
c(6, 13, 5, 6, 0)
)
g <- igraph::make_ring(5)

complete_Gamma(G, g)



graphicalExtremes documentation built on Nov. 14, 2023, 1:07 a.m.