EGA.fit | R Documentation |
EGA
Optimal Model Fit using the Total Entropy Fit Index (tefi
)Estimates the best fitting model using EGA
.
The number of steps in the cluster_walktrap
detection
algorithm is varied and unique community solutions are compared using
tefi
.
EGA.fit(
data,
n = NULL,
corr = c("auto", "cor_auto", "cosine", "pearson", "spearman"),
na.data = c("pairwise", "listwise"),
model = c("BGGM", "glasso", "TMFG"),
algorithm = c("leiden", "louvain", "walktrap"),
plot.EGA = TRUE,
verbose = FALSE,
...
)
data |
Matrix or data frame. Should consist only of variables to be used in the analysis |
n |
Numeric (length = 1).
Sample size if |
corr |
Character (length = 1).
Method to compute correlations.
Defaults to
For other similarity measures, compute them first and input them
into |
na.data |
Character (length = 1).
How should missing data be handled?
Defaults to
|
model |
Character (length = 1).
Defaults to
|
algorithm |
Character or
|
plot.EGA |
Boolean.
If |
verbose |
Boolean.
Whether messages and (insignificant) warnings should be output.
Defaults to |
... |
Additional arguments to be passed on to
|
Returns a list containing:
EGA |
|
EntropyFit |
|
Lowest.EntropyFit |
The best fitting solution based on |
parameter.space |
Parameter values used in search space |
Hudson Golino <hfg9s at virginia.edu> and Alexander P. Christensen <alexpaulchristensen@gmail.com>
Entropy fit measures
Golino, H., Moulder, R. G., Shi, D., Christensen, A. P., Garrido, L. E., Neito, M. D., Nesselroade, J., Sadana, R., Thiyagarajan, J. A., & Boker, S. M. (in press).
Entropy fit indices: New fit measures for assessing the structure and dimensionality of multiple latent variables.
Multivariate Behavioral Research.
Simulation for EGA.fit
Jamison, L., Christensen, A. P., & Golino, H. (under review).
Optimizing Walktrap's community detection in networks using the Total Entropy Fit Index.
PsyArXiv.
Leiden algorithm
Traag, V. A., Waltman, L., & Van Eck, N. J. (2019).
From Louvain to Leiden: guaranteeing well-connected communities.
Scientific Reports, 9(1), 1-12.
Louvain algorithm
Blondel, V. D., Guillaume, J. L., Lambiotte, R., & Lefebvre, E. (2008).
Fast unfolding of communities in large networks.
Journal of Statistical Mechanics: Theory and Experiment, 2008(10), P10008.
Walktrap algorithm
Pons, P., & Latapy, M. (2006).
Computing communities in large networks using random walks.
Journal of Graph Algorithms and Applications, 10, 191-218.
plot.EGAnet
for plot usage in EGAnet
# Load data
wmt <- wmt2[,7:24]
# Estimate optimal EGA with Walktrap
fit.walktrap <- EGA.fit(
data = wmt, algorithm = "walktrap",
steps = 3:8, # default
plot.EGA = FALSE # no plot for CRAN checks
)
# Estimate optimal EGA with Leiden and CPM
fit.leiden <- EGA.fit(
data = wmt, algorithm = "leiden",
objective_function = "CPM", # default
# resolution_parameter = seq.int(0, max(abs(network)), 0.01),
# For CPM, the default max resolution parameter
# is set to the largest absolute edge in the network
plot.EGA = FALSE # no plot for CRAN checks
)
# Estimate optimal EGA with Leiden and modularity
fit.leiden <- EGA.fit(
data = wmt, algorithm = "leiden",
objective_function = "modularity",
resolution_parameter = seq.int(0, 2, 0.05),
# default for modularity
plot.EGA = FALSE # no plot for CRAN checks
)
## Not run:
# Estimate optimal EGA with Louvain
fit.louvain <- EGA.fit(
data = wmt, algorithm = "louvain",
resolution_parameter = seq.int(0, 2, 0.05), # default
plot.EGA = FALSE # no plot for CRAN checks
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.