
Functional PCA, graph convolution and attention, persistent homology, possibilistic clustering, REML components
Source:R/SpatialFunctional.R
CurveFpca.RdCurveFpca: functional PCA on a common grid with trapezoid weights
(eigenfunctions of W^(1/2) C W^(1/2) rescaled to unit L2 norm,
largest value positive). GcnLayer: sigma(D^(-1/2) (A + I) D^(-1/2) H W).
SgcRidge: ridge regression on S^K X (intercept unpenalised).
GatLayer: one-head graph attention with LeakyReLU scores and
softmax over neighbours. RipsPersistence: Vietoris-Rips persistence
in dimensions 0 and 1 by boundary-matrix reduction over Z/2 (rows are
dimension, birth, death; zero-persistence pairs dropped).
PersistenceLandscape: lambda_k(t), the k-th largest tent
max(0, min(t - b, d - t)). PossibilisticCmeans: possibilistic
c-means with omega from fuzzy c-means (as ppclust::pcm).
RemlComponents: REML variance components by average-information
Newton steps with step halving and a boundary floor of 1e-10 var(y); CrossedRandomEffects and NestedRandomEffects
build the indicator designs.
Usage
CurveFpca(curves, t, n_components = 2)
GcnLayer(A, H, Wt, activation = "relu", self_loops = TRUE)
SgcRidge(A, X, y, k = 2, l2 = 1, self_loops = TRUE)
GatLayer(
A,
H,
Wt,
a,
negative_slope = 0.2,
activation = "linear",
self_loops = TRUE
)
RipsPersistence(points, max_dim = 1, max_scale = Inf, distance_matrix = FALSE)
PersistenceLandscape(diagram, t, k_max = 3, dimension = NULL)
PossibilisticCmeans(
X,
centers,
m = 2,
omega = NULL,
K = 1,
max_iter = 1000,
con_val = 1e-09
)
RemlComponents(y, X, Zs, max_iter = 200, tol = 1e-12)
CrossedRandomEffects(y, a, b, X = NULL)
NestedRandomEffects(y, a, b, X = NULL)Arguments
- curves
Matrix of curves (rows).
- t
Grid, or evaluation points for the landscape.
- n_components
Number of components.
- A
Adjacency matrix.
- H
Node features.
- Wt
Layer weights.
- activation
"relu", "tanh" or "linear".
- self_loops
Add self loops.
- X
Node features, data matrix, or fixed-effects design.
- y
Response.
- k
Number of propagation steps.
- l2
Ridge penalty.
- a
Attention vector (length twice the output width), or factor codes.
- negative_slope
LeakyReLU slope.
- points
Point coordinates (rows) or a distance matrix.
- max_dim
Largest homology dimension (0 or 1).
- max_scale
Largest filtration value.
- distance_matrix
Treat
pointsas distances.- diagram
Persistence diagram rows.
- k_max
Number of landscape functions.
- dimension
Homology dimension to use, or NULL.
- centers
Initial prototypes.
- m
Fuzzifier.
- omega
Bandwidths, or NULL to derive them from fuzzy c-means.
- K
Omega multiplier.
- max_iter
Iteration limit.
- con_val
Convergence tolerance on the prototypes.
- Zs
List of random-effect design matrices.
- tol
Relative step tolerance.
- b
Second factor codes.
References
Ramsay, J. O. and Silverman, B. W. (2005). Functional Data Analysis. Kipf, T. N. and Welling, M. (2017). ICLR 2017. Wu, F. et al. (2019). ICML 2019. Velickovic, P. et al. (2018). ICLR 2018. Edelsbrunner, H., Letscher, D. and Zomorodian, A. (2002). Discrete Comput. Geom. 28, 511-533. Bubenik, P. (2015). JMLR 16, 77-102. Krishnapuram, R. and Keller, J. M. (1993). IEEE Trans. Fuzzy Systems 1, 98-110. Patterson, H. D. and Thompson, R. (1971). Biometrika 58, 545-554. Gilmour, A. R., Thompson, R. and Cullis, B. R. (1995). Biometrics 51, 1440-1450.
Examples
RipsPersistence(rbind(c(0, 0), c(1, 0), c(1, 1), c(0, 1)))$diagram
#> dimension birth death
#> [1,] 0 0 1.000000
#> [2,] 0 0 1.000000
#> [3,] 0 0 1.000000
#> [4,] 0 0 Inf
#> [5,] 1 1 1.414214
PersistenceLandscape(rbind(c(0, 2), c(1, 3)), c(0.5, 1, 1.5, 2), k_max = 2)
#> [,1] [,2] [,3] [,4]
#> [1,] 0.5 1 0.5 1
#> [2,] 0.0 0 0.5 0