# mctest.ergoInfo: Monte-Carlo Test for the Ergodicity Information Index In EGAnet: Exploratory Graph Analysis - A Framework for Estimating the Number of Dimensions in Multivariate Data Using Network Psychometrics

## Description

Computes a Monte-Carlo Test for the Ergodicity Information Index, comparing the empirical Ergodicity Information index to values obtained in a Monte-Carlo simulation in which all individuals have a similar latent structure. The p-values in the Monte-Carlo test can be calculated as `(sum(EII>=MC.EII)+1)/(iter+1)` and as `(sum(EII<=MC.EII)+1)/(iter+1)`, where EII is the empirical Ergodicity Information Index, MC.EII is the values of the Ergodicity Information Index obtained in the simulation, and `iter` is the number of random samples generated in the simulation. The two-sided p-value is computed as two times the lowest p-value. In the Monte-Carlo Test for the Ergodicity Information Index, the null hypothesis is that the empirical value of EII is equal to the Monte-Carlo value of EII obtained in multiple individuals with a similar latent structure. Small values of p indicate that is very unlikely to obtain an EII as large as the one obtained in the empirical sample if the null hypothesis is true, thus there is convincing evidence that the empirical Ergodicity Information Index is different than it could be expected if all individuals had a similar latent structure, conditioned on the parameters used to simulate the data.

## Usage

 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27``` ```mctest.ergoInfo( iter, N, EII, use, variab, timep, nfact, error, dfm, loadings, autoreg, crossreg, var.shock, cov.shock, embed, tau, delta, derivatives, model, model.args = list(), algorithm = c("walktrap", "louvain"), algorithm.args = list(), corr, ncores, ... ) ```

## Arguments

 `iter` Numeric integer. Number of random samples to generate in the Monte-Carlo simulation. At least `500` is recommended `N` Numeric integer. Number of individuals to simulate data from, using the `simDFM` function. `EII` Numeric. Empirical Ergodicity Information Index obtained via the `ergoInfo` function. `use` Character. A string indicating what network element will be used to compute the algorithm complexity in the `ergoInfo` function, the list of edges or the weights of the network. Defaults to `use = "edge.list"`. Current options are: `edge.list` Calculates the algorithm complexity using the list of edges. `weights` Calculates the algorithm complexity using the weights of the network. `variab` Number of variables per factor. `timep` Number of time points. `nfact` Number of factors. `error` Value to be used to construct a diagonal matrix Q. This matrix is p x p covariance matrix Q that will generate random errors following a multivariate normal distribution with mean zeros. The value provided is squared before constructing Q. `dfm` A string indicating the dynamical factor model to use. Defaults to `"DAFS"`. Current options are: `DAFS` Simulates data using the direct autoregressive factor score model. This is the default method `RandomWalk` Simulates data using a dynamic factor model with random walk factor scores. `loadings` Magnitude of the loadings. `autoreg` Magnitude of the autoregression coefficients. Default is `"autoreg = 0.8"`. `crossreg` Magnitude of the cross-regression coefficients. Default is `"crossreg = 0.1"`. `var.shock` Magnitude of the random shock variance. Default is `"var.shock = 0.18"`. `cov.shock` Magnitude of the random shock covariance Default is `"cov.shock = 0.36"`. `embed` Integer. Number of embedded dimensions (the number of observations to be used in the `Embed` function). For example, an `"embed = 5"` will use five observations to estimate a single derivative. Defaults to `embed = 5`. `tau` Integer. Number of observations to offset successive embeddings in the `Embed` function. A tau of one uses adjacent observations. Default is `"tau = 1"`. `delta` Integer. The time between successive observations in the time series. Default is `"delta = 1"`. `derivatives` Integer. The order of the derivative to be used in the EGA procedure. Default to 1. `model` Character. A string indicating the method to use. Defaults to `glasso`. Current options are: `glasso` Estimates the Gaussian graphical model using graphical LASSO with extended Bayesian information criterion to select optimal regularization parameter. This is the default method `TMFG` Estimates a Triangulated Maximally Filtered Graph `model.args` List. A list of additional arguments for `EBICglasso.qgraph` or `TMFG` `algorithm` A string indicating the algorithm to use or a function from `igraph` Current options are: `walktrap` Computes the Walktrap algorithm using `cluster_walktrap` `louvain` Computes the Walktrap algorithm using `cluster_louvain` `algorithm.args` List. A list of additional arguments for `cluster_walktrap`, `cluster_louvain`, or some other community detection algorithm function (see examples) `corr` Type of correlation matrix to compute. The default uses `cor_auto`. Current options are: `cor_auto` Computes the correlation matrix using the `cor_auto` function from `qgraph`. `pearson` Computes Pearson's correlation coefficient using the pairwise complete observations via the `cor` function. `spearman` Computes Spearman's correlation coefficient using the pairwise complete observations via the `cor` function. `ncores` Numeric. Number of cores to use in computing results. Defaults to `parallel::detectCores() / 2` or half of your computer's processing power. Set to `1` to not use parallel computing. Recommended to use maximum number of cores minus one If you're unsure how many cores your computer has, then use the following code: `parallel::detectCores()` `...` Additional arguments. Used for deprecated arguments from previous versions of `EGA`

## Value

Returns a list containing:

 `mc.ergoInfo` The values of the Ergodicity Information Index obtained in the Monte-Carlo Simulation `p.value.twosided` The p-value of the Monte-Carlo test for the Ergodicity Information Index. The null hypothesis is that the empirical Ergodicity Information index is equal to the expected value of the EII if the all individuals had similar latent structures. `effect` Indicates wheter the empirical EII is greater or less then the Monte-Carlo obtained EII. `plot.dist` Histogram of the bootstrapped ergodicity information index

## Author(s)

Hudson Golino <hfg9s at virginia.edu>

## Examples

 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15``` ```## Not run: \donttest{ dyn1 <- dynEGA.ind.pop(data = sim.dynEGA, n.embed = 5, tau = 1, delta = 1, id = 21, group = 22, use.derivatives = 1, model = "glasso", ncores = 2, corr = "pearson") eii1 <- ergoInfo(data = dyn1)\$EII dist.ergoinfo <- mctest.ergoInfo(iter = 10, N = 10, EII = eii1, variab = 4, timep = 100, nfact = 2, error = 0.05, dfm = "DAFS", loadings = 0.55, autoreg = 0.8, crossreg = 0.1, var.shock = 0.18, cov.shock = 0.36, embed = 5, tau=1, delta=1, derivatives=1, model = "glasso", ncores = 2, corr = "pearson") } ## End(Not run) ```

EGAnet documentation built on Feb. 17, 2021, 1:06 a.m.