Learn R Programming

NetworkToolbox (version 1.4.2)

MFCF: Maximally Filtered Clique Forest

Description

Applies the Maximally Filtered Clique Forest (MFCF) filtering method (Please see and cite Massara & Aste).

Usage

MFCF(
  data,
  cases = NULL,
  na.data = c("pairwise", "listwise", "fiml", "none"),
  time.series = FALSE,
  gain.fxn = c("logLik", "logLik.val", "rSquared.val"),
  min_size = 0,
  max_size = 8,
  pval = 0.05,
  pen = 0,
  drop_sep = FALSE,
  use_returns = FALSE
)

Arguments

data

Matrix (n x n or p x n) or data frame. Can be a dataset or a correlation matrix

cases

Numeric. If data is a (partial) correlation matrix, then number of cases must be input. Defaults to NULL

na.data

Character. How should missing data be handled?

  • "listwise" Removes case if any missing data exists. Applies na.omit

  • "pairwise" Estimates correlations using the available data for each variable

  • "fiml" Estimates correlations using the Full Information Maximum Likelihood. Recommended and most robust but time consuming

  • "none" Default. No missing data or missing data has been handled by the user

time.series

Boolean. Is data a time-series dataset? Defaults to FALSE. Set to TRUE to handle time-series data (n x p)

gain.fxn

Character. Gain function to be used for inclusion of nodes in cliques. There are several options available (see gain.functions for more details): "logLik", "logLik.val", "rSquared.val". Defaults to "rSquared.val"

min_size

Numeric. Minimum number of nodes allowed per clique. Defaults to 0

max_size

Numeric. Maximum number of nodes allowed per clique. Defaults to 8

pval

Numeric. p-value used to determine cut-offs for nodes to include in a clique

pen

Numeric. Multiplies the number of edges added to penalise complex models. Similar to the penalty term in AIC

drop_sep

Boolean. This parameter influences the MFCF only. Defaults to FALSE. If TRUE, then any separator can be used only once (similar to the TMFG)

use_returns

Boolean. Only used in "gain.fxn = rSquared.val". If set to TRUE the regression is performed on log-returns. Defaults to FALSE

Value

Returns a list containing:

A

MFCF filtered partial correlation network (adjacency matrix)

J

MFCF filtered inverse covariance matrix (precision matrix)

cliques

Cliques in the network (output for LoGo)

separators

Separators in the network (output for LoGo)

References

Massara, G. P. & Aste, T. (2019). Learning clique forests. ArXiv.

Examples

Run this code
# NOT RUN {
# Load data
data <- neoOpen

# }
# NOT RUN {
# Use polychoric correlations and R-squared method
MFCF.net <- MFCF(qgraph::cor_auto(data), cases = nrow(neoOpen))$A

# }
# NOT RUN {
# }

Run the code above in your browser using DataLab