| Title: | Flexible and Accurate Methods for Estimation and Inference of Gaussian Graphical Models with Applications |
|---|---|
| Description: | Flexible and Accurate Methods for Estimation and Inference of Gaussian Graphical Models with Applications. |
| Authors: | Yueqi QIAN [aut, cre] (ORCID: <https://orcid.org/0000-0001-5795-1307>) |
| Maintainer: | Yueqi QIAN <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.0.0.9007 |
| Built: | 2026-05-11 07:39:39 UTC |
| Source: | https://github.com/yanglabhkust/flag |
FLAG is the main function to fulfill the whole process.
FLAG( data, scale.var = T, low.rank = NULL, infer = "llr", eps = 1e-07, crit.loglik = 1e-04 )FLAG( data, scale.var = T, low.rank = NULL, infer = "llr", eps = 1e-07, crit.loglik = 1e-04 )
data |
Matrix, with size n*p. |
scale.var |
Logical, whether to scale the variance of X to 1/p, default to be T(RUE). |
low.rank |
Logical, whether to use low rank update to shrink the time of eigen-decomposition of XX^T, default to be TRUE when sample size larger than 1000. |
infer |
Character, option of different tests of inference where 'llr' for likelihood ratio test and 'wald' for Wald test based on Fisher Information Matrix. |
eps |
Numeric, a small term to avoid numerical problems, default to be 1e-7. |
crit.loglik |
Numeric, the criteria of the change ratio of log likelihood to stop. |
List, the estimated precision matrix, the p-value of precision matrix estimation, the edge existence using Bonferroni correction, the edge existence using false discovery rate, the matrix of estimated eta, the standard error or estimated eta, the matrix of estimated partial correlation rho, the standard error or estimated partial correlation rho, the p-value of partial correlation matrix estimation, the matrix of estimated sigma_a^2, the standard error or estimated sigma_b^2, the execution time.
FLAG(matrix)FLAG(matrix)
Use FLAG to infer one edge. Given n*p data matrix, when we only interest in the conditional dependence between i-th and j-th variables.
FlagOneEdge(data, i, j, scale.var = T, infer = "llr", eps = 1e-07)FlagOneEdge(data, i, j, scale.var = T, infer = "llr", eps = 1e-07)
data |
Matrix, with size n*p. |
i |
integer, the index of one element. |
j |
integer, the index of another element. |
scale.var |
Logical, whether to scale the variance of X to 1/p, default to be T(RUE). |
infer |
Character, option of different tests of inference where 'llr' for likelihood ratio test and 'wald' for Wald test based on Fisher Information Matrix. |
eps |
Numeric, a small term to avoid numerical problems, default to be 1e-7. |
List, the list of log likelihood during iterations, the estimated precision value, the p-value of precision value estimation, the estimated Gamma_beta matrix with size 22, in the random effects model, the estimated Gamma_epsilon matrix with size 22, in the random effects model, the estimated off-diagonal element eta in the matrix Gamma_epsilon, the standard error of eta, the estimated partial correlation rho, the standard error of rho, the p-value of rho, the execution time.
FlagOneEdge(matrix, i, j)FlagOneEdge(matrix, i, j)
FLAG for one pair of random variables, using random effects model. This is a repeated function for FLAG.
FlagOnePair( Y, X, Gamma_beta = NULL, Gamma_e = NULL, infer = "llr", fix.eta = FALSE, eps = 1e-07, max.iter = 5000, crit.loglik = 1e-04 )FlagOnePair( Y, X, Gamma_beta = NULL, Gamma_e = NULL, infer = "llr", fix.eta = FALSE, eps = 1e-07, max.iter = 5000, crit.loglik = 1e-04 )
Y |
Matrix, with size n*2. |
X |
Matrix, with size n*(p-2). |
Gamma_beta |
Matrix, with size 2*2. |
Gamma_e |
Matrix, with size 2*2. |
infer |
Character, option of different tests of inference where 'llr' for likelihood ratio test and 'wald' for Wald test based on Fisher Information Matrix. |
fix.eta |
Logical, whether to fix eta, default to be FALSE. |
eps |
Numeric, a small term to avoid numerical problems, default to be 1e-7. |
max.iter |
Integer, the maximum number of iterations, default to be 5000. |
crit.loglik |
Numeric, the criteria of the change ratio of log likelihood to stop. |
List, the list of log likelihood during iterations, the estimated Gamma_beta matrix with size 22, in the random effects model, the estimated Gamma_epsilon matrix with size 22, in the random effects model, the estimated 2*2 submatrix of the precision matrix, the covariance matrix, which is the inverse of the Fisher information matrix, inferred by the Wald test, the estimated off-diagonal element eta in the matrix Gamma_epsilon, the standard error of eta, the p-value of eta, the estimated partial correlation rho, the standard error of rho, the p-value of rho.
FlagOnePair(Y, X)FlagOnePair(Y, X)
FLAG for one pair of random variables fixing eta as zero, using likelihood-ratio test.
FlagOnePairEta0( Y, X, Gamma_beta, Gamma_e, eps = 1e-07, max.iter = 5000, crit.loglik = 1e-04 )FlagOnePairEta0( Y, X, Gamma_beta, Gamma_e, eps = 1e-07, max.iter = 5000, crit.loglik = 1e-04 )
Y |
Matrix, with size n*2. |
X |
Matrix, with size n*(p-2). |
Gamma_beta |
Matrix, with size 2*2. |
Gamma_e |
Matrix, with size 2*2. |
eps |
Numeric, a small term to avoid numerical problems, default to be 1e-4. |
max.iter |
Integer, the maximum number of iterations, default to be 5000. |
crit.loglik |
Numeric, the criteria of the change ratio of log likelihood to stop. |
List, the list of log likelihood during iterations, Numeric, the log likelihood of the last iterations, the estimated Gamma_beta matrix with size 22, in the random effects model, the estimated Gamma_epsilon matrix with size 22, in the random effects model, the estimated 2*2 submatrix of the precision matrix.
FlagOnePairEta0(Y, X, Gamma_beta, Gamma_e)FlagOnePairEta0(Y, X, Gamma_beta, Gamma_e)
Get the standard error of rho.
GetSeRho(Gamma_e, Gamma_e_cov)GetSeRho(Gamma_e, Gamma_e_cov)
Gamma_e |
Matrix, with size 2*2. |
Gamma_e_cov |
Matrix, with size 2*2. |
Numeric.
GetSeRho(Gamma_e,Gamma_e_cov)GetSeRho(Gamma_e,Gamma_e_cov)
Infer by the Wald test.
InferWald(Omega.inv, n, K, Y.vec, Gamma_e)InferWald(Omega.inv, n, K, Y.vec, Gamma_e)
Omega.inv |
Matrix, with size (2n)*(2n). |
n |
Integer. |
K |
Matrix, with size n*n. |
Y.vec |
Matrix, with size (2*n)*1, the vectorized Y. |
Gamma_e |
Matrix, with size 2*2. |
List, the covariance matrix, which is the inverse of the Fisher information matrix, inferred by the Wald test, the estimated off-diagonal element eta in the matrix Gamma_epsilon, the standard error of eta, the p-value of eta, the estimated partial correlation rho, the standard error of rho, the p-value of rho.
InferWald(Omega.inv, n, K, Y.vec, Gamma_e)InferWald(Omega.inv, n, K, Y.vec, Gamma_e)