## Version 0.1.0 o FIX: several bugs in `simulate_smallworld`; also updated edge weight assignment o UPDATE: SUR model updated with proper SE parameter o UPDATE: adaptive regularization uses first decile for distributions in `network_estimation` o UPDATE: internal MLE for Gumbel was updated to root finding function (slightly faster) o UPDATE: `smallworldness()` offers weighted version, placing largest edge weights on the nearest neighbors o REMOVE: `ring2lattice()` algorithm was revised and the logic updated to the `proxswap_lattice()` algorithm - `proxswap_lattice()`: Converts a network matrix into a connected ring lattice whose degree sequence exactly matches the original, while maximising the average local clustering coefficient. Accepts any weighted or binary network directly; the binary adjacency is derived internally from non-zero entries. The algorithm runs `shuffles` (default 100) independent passes. Each pass randomly permutes the degree sequence onto ring positions, then runs a proximity construction (implemented in C via `proximity_pass_c`) that assigns edges greedily in increasing ring-distance order, prioritising high-need pairs at each distance band. Any residual degree deficit is resolved by a swap-repair phase (implemented in C via `swapping_pass_c`) that connects the highest-deficit node to its nearest available ring neighbour, performing an edge swap when no direct partner with remaining budget exists. Passes that yield a disconnected graph or an unsatisfied degree sequence are discarded. When `weighted = TRUE`, edge weights from the original network are reassigned to lattice edges by ring distance following Muldoon, Bridgeford, & Bassett (2016): largest-magnitude weights are placed on shortest-distance edges, with original signs preserved. Among valid passes the one with the highest average clustering coefficient is returned; if no valid pass is found, or if the best lattice clustering coefficient is lower than that of the original network, the empirical adjacency (or weighted matrix) is returned with a warning. The resulting average clustering coefficient is attached as attribute `"CC"`. ## Initial Commit: Version 0.0.1 ### Network Estimation - `network_estimation()`: Estimates Gaussian graphical models using L0 penalty approximations (atan, exp, gumbel, weibull) via single-pass or full Local Linear Approximation (LLA). Supports adaptive penalties, multiple information criteria (AIC, AICc, BIC, BIC0, EBIC, MBIC), and automatic correlation computation for mixed continuous/ordinal data ### Fit Evaluation - `network_fit()`: Computes traditional structural equation model-style fit metrics for an estimated network, including chi-square, RMSEA (with CIs), CFI, TLI, SRMR, log-likelihood, AIC, and BIC - `edge_confusion()`: Computes confusion matrix metrics (sensitivity, specificity, PPV, NPV, FDR, FOM, balanced accuracy, F1, CSI, MCC) for comparing an estimated network against a ground-truth network ### Correlation Utilities - `auto_correlate()`: Automatically selects and computes appropriate correlations for mixed data types — Pearson for continuous, polychoric for ordinal, tetrachoric for binary, and polyserial/biserial for mixed pairs - `polychoric_matrix()`: Fast C implementation of polychoric correlations using the Beasley-Springer-Moro algorithm, Drezner-Wesolosky bivariate normal approximation, and Brent's optimization method ### Data Simulation - `ring2lattice()`: Converts a partial correlation network matrix into a near-degree-preserving ring lattice for use as the lattice baseline in small-worldness calculations. Derives the binary adjacency internally, reorders nodes by degree, seeds a ring lattice from a circular-distance threshold, and runs dual pruning passes (highest-first and lowest-first surplus order) with a lexicographic edge-removal priority (clustering constraint, surplus, ring distance). Retains whichever pass minimises total residual surplus (ties broken by average clustering coefficient), with a final fallback to the empirical adjacency when the lattice cannot exceed the empirical clustering coefficient. Attaches the resulting average clustering coefficient as the attribute `"CC"` - `simulate_smallworld()`: Simulates data from a GGM with a small-world network structure using degree-weighted rewiring. Supports continuous and skewed data, and accepts control over nodes, density, rewire probability, sample size, and signal-to-noise ratio - `simulate_sbm()`: Simulates data from a GGM with a stochastic block model (SBM) structure. Community edge densities are controlled via a block density matrix; edge weights are drawn from a Weibull distribution whose parameters are predicted from network size and sample size ### Supporting Functions - `weibull_parameters()`: Predicts Weibull shape and scale parameters for absolute partial correlation edge weights given network size, sample size, and signal-to-noise ratio, using a Seemingly Unrelated Regression (SUR) model fitted to 194 empirical psychometric networks - `categorize()`: Converts continuous data to ordinal categories (2–6+) with optional skew control based on empirical category boundary tables (Garrido, Abad, & Ponsoda, 2011) ### Datasets - `basic_smallworld`: Toy small-world network dataset (n = 500, 20 variables) generated via `simulate_smallworld()` for use in examples