Functions for generating graph laplacian matrices based on nearest neighbors in a grid structure or neighbors a certain distance apart.

1 2 | ```
laplacian(dims)
distLaplacian(matrix,window=2)
``` |

`dims` |
A vector containing the dimensions of the underlying grid. One, two and three-dimensional grids are supported. |

`matrix` |
A full distance matrix. This can be computed via any distance metric. |

`window` |
A scalar denoting the maximum distance at which points are considered neighbors, meaning they share an edge in the graph structure. |

Graph Laplacian matrices can be used as generalizing operators in the GPCA framework. These behave like inverse covariances and are useful for recovering edges in the GPCA factors. Laplacians are defined as the degree matrix minus the adjacency matrix for a network structure.

For variables structured as a grid, Laplacians are constructed by
placing edges between neighbors in the grid structure. For
one dimensional grids (e.g. equally-spaced time points), this is a chain
graph. Nearest neighbors for two and three dimensional grids
(e.g. image data) are defined using the Chebychev distance. Laplacians
for grid structures are scaled to have operator norm one, which is
required for use with `gpca`

and `sgpca`

.

Laplacians are constructed from a general distance matrix by placing
edges between variables less than or equal to `window`

distance
apart. These are returned without scaling to have operator norm one,
and must be appropriately scaled before used with `gpca`

and
`sgpca`

.

`Q` |
A sparse matrix of the class dgCMatrix. |

Frederick Campbell

1 2 3 4 5 6 7 8 9 10 |

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

All documentation is copyright its authors; we didn't write any of that.