Title: | Partial Separability and Functional Graphical Models for Multivariate Gaussian Processes |
---|---|
Description: | Estimates a functional graphical model and a partially separable KL decomposition for a multivariate Gaussian process. |
Authors: | @author Javier Zapata, Sang-Yun Oh & Alexander Petersen |
Maintainer: | Javier Zapata <[email protected]> |
License: | GPL (>= 2) |
Version: | 1.0 |
Built: | 2025-02-16 03:16:06 UTC |
Source: | https://github.com/javzapata/fgm |
Estimates a sparse adjacency matrix representing the conditional dependency structure between features of a multivariate Gaussian process
fgm( y, L, alpha, gamma, t = seq(0, 1, length.out = dim(y[[1]])[2]), thr.FVE = 95, include.Omega = F )
fgm( y, L, alpha, gamma, t = seq(0, 1, length.out = dim(y[[1]])[2]), thr.FVE = 95, include.Omega = F )
y |
list of length p containing densely observed multivariate (p-dimensional) functional data. |
L |
the number of eigenfunctions used for dimension reduction using the partially separable Karhunen-Loeve (PSKL) expansion obtained using 'pfpca()'. This argument can take positive integer values greater or equal to 1. |
alpha |
penalty parameter for the common sparsity pattern taking values in |
gamma |
penalty parameter for the overall sparsity pattern taking positive values. |
t |
(optional) grid on which functional data is observed, defaults to |
thr.FVE |
this parameter sets a threshold for the minimum percentage of functional variance that the PSKL eigenfunctions (obtained using 'pfpca()') should explained. This criterion is used only if a value for L is not provided or is greater than the maximum possible number of eigenfunctions estimated from |
include.Omega |
logical variable indicating wheter to include the list of precision matrices in the output. Default value is FALSE. |
This function implements the functional graphical model in Zapata, Oh, and Petersen (2019).
The arguments alpha
and gamma
are a reparameterization of the Group Graphical Lasso tuning parameters when using the JGL
package. When using JGL::JGL
, the tuning parameters are computed as lambda1 = alpha*gamma
and lambda2 = (1-alpha)*gamma
A list with letters and numbers.
A
Resulting adjacency matrix as the union of all the Omega matrices
L
number of PSKL expansion eigenfunctions considered for the estimation of the graphical model.
Omega
list of of precision matrices obtained using the multivariate functional principal component scores theta obtained using 'fpca()'
Javier Zapata, Sang-Yun Oh and Alexander Petersen
(1) Zapata, J., Oh, S., and Petersen, A. (2019) Functional Graphical Models for Partially Separable Gaussian Processes. Available at arXiv.org
## Variables # Omega - list of precision matrices, one per eigenfunction # Sigma - list of covariance matrices, one per eigenfunction # theta - list of functional principal component scores # phi - list of eigenfunctions densely observed on a time grid # y - list containing densely observed multivariate (p-dimensional) functional data library(mvtnorm) library(fda) ## Generate data y source(system.file("exec", "getOmegaSigma.R", package = "fgm")) theta = lapply(1:nbasis, function(b) t(rmvnorm(n = 100, sigma = Sigma[[b]]))) theta.reshaped = lapply( 1:p, function(j){ t(sapply(1:nbasis, function(i) theta[[i]][j,])) }) phi.basis=create.fourier.basis(rangeval=c(0,1), nbasis=21, period=1) t = seq(0, 1, length.out = time.grid.length) chosen.basis = c(2, 3, 6, 7, 10, 11, 16, 17, 20, 21) phi = t(predict(phi.basis, t))[chosen.basis,] y = lapply(theta.reshaped, function(th) t(th)%*%phi) ## Solve fgm(y, alpha=0.5, gamma=0.8)
## Variables # Omega - list of precision matrices, one per eigenfunction # Sigma - list of covariance matrices, one per eigenfunction # theta - list of functional principal component scores # phi - list of eigenfunctions densely observed on a time grid # y - list containing densely observed multivariate (p-dimensional) functional data library(mvtnorm) library(fda) ## Generate data y source(system.file("exec", "getOmegaSigma.R", package = "fgm")) theta = lapply(1:nbasis, function(b) t(rmvnorm(n = 100, sigma = Sigma[[b]]))) theta.reshaped = lapply( 1:p, function(j){ t(sapply(1:nbasis, function(i) theta[[i]][j,])) }) phi.basis=create.fourier.basis(rangeval=c(0,1), nbasis=21, period=1) t = seq(0, 1, length.out = time.grid.length) chosen.basis = c(2, 3, 6, 7, 10, 11, 16, 17, 20, 21) phi = t(predict(phi.basis, t))[chosen.basis,] y = lapply(theta.reshaped, function(th) t(th)%*%phi) ## Solve fgm(y, alpha=0.5, gamma=0.8)
Estimates the Karhunen-Loeve expansion for a partially separable multivariate Gaussian process.
pfpca(y, t = seq(0, 1, length.out = dim(y[[1]])[2]))
pfpca(y, t = seq(0, 1, length.out = dim(y[[1]])[2]))
y |
list of length p containing densely observed multivariate (p-dimensional) functional data . |
t |
(optional) grid on which functional data is observed, defaults to seq(0, 1, m) where |
This function implements the functional graphical model in Zapata, Oh, and Petersen (2019). This code uses functions from the testing version of fdapace available at: https://github.com/functionaldata/tPACE.
A list with three variables:
phi
Lxm matrix where each row denotes the value of a basis function evaluated at a grid of length m
theta
list of length L of functional principal component scores. theta[[l]]
is an nxp matrix of vector scores corresponding to the basis function phi[l,]
FVE
fraction of variability explained by the first L components
Javier Zapata, Sang-Yun Oh and Alexander Petersen
Zapata, J., Oh, S., and Petersen, A. (2019) Functional Graphical Models for Partially Separable Gaussian Processes. Available at arXiv.org
## Variables # Omega - list of precision matrices, one per eigenfunction # Sigma - list of covariance matrices, one per eigenfunction # theta - list of functional principal component scores # phi - list of eigenfunctions densely observed on a time grid # y - list containing densely observed multivariate (p-dimensional) functional data library(mvtnorm) library(fda) ## Generate data y source(system.file("exec", "getOmegaSigma.R", package = "fgm")) theta = lapply(1:nbasis, function(b) t(rmvnorm(n = 100, sigma = Sigma[[b]]))) theta.reshaped = lapply( 1:p, function(j){ t(sapply(1:nbasis, function(i) theta[[i]][j,])) }) phi.basis=create.fourier.basis(rangeval=c(0,1), nbasis=21, period=1) t = seq(0, 1, length.out = time.grid.length) chosen.basis = c(2, 3, 6, 7, 10, 11, 16, 17, 20, 21) phi = t(predict(phi.basis, t))[chosen.basis,] y = lapply(theta.reshaped, function(th) t(th)%*%phi) ## Solve pfpca(y)
## Variables # Omega - list of precision matrices, one per eigenfunction # Sigma - list of covariance matrices, one per eigenfunction # theta - list of functional principal component scores # phi - list of eigenfunctions densely observed on a time grid # y - list containing densely observed multivariate (p-dimensional) functional data library(mvtnorm) library(fda) ## Generate data y source(system.file("exec", "getOmegaSigma.R", package = "fgm")) theta = lapply(1:nbasis, function(b) t(rmvnorm(n = 100, sigma = Sigma[[b]]))) theta.reshaped = lapply( 1:p, function(j){ t(sapply(1:nbasis, function(i) theta[[i]][j,])) }) phi.basis=create.fourier.basis(rangeval=c(0,1), nbasis=21, period=1) t = seq(0, 1, length.out = time.grid.length) chosen.basis = c(2, 3, 6, 7, 10, 11, 16, 17, 20, 21) phi = t(predict(phi.basis, t))[chosen.basis,] y = lapply(theta.reshaped, function(th) t(th)%*%phi) ## Solve pfpca(y)