--- title: "Stepwise unregularized GGM" output: rmarkdown::html_vignette vignette: > %\VignetteIndexEntry{Stepwise unregularized GGM} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8} --- ```{r setup, include = FALSE} knitr::opts_chunk$set(collapse = TRUE, comment = "#>", fig.width = 6, fig.height = 5) has_cograph <- requireNamespace("cograph", quietly = TRUE) ``` ```{r} library(psychnets) ``` `method = "ggm"` is a different philosophy from the graphical lasso. The lasso *shrinks* every edge toward zero; the stepwise GGM uses the lasso path only to **propose** candidate graphs, then refits the **unregularized** maximum-likelihood precision on each and picks the best by extended BIC, refining it with a greedy edge add/drop search. The retained edges are therefore **not shrunk** -- they are the exact partial correlations for the selected structure. It is equivalent to `qgraph::ggmModSelect()` (accepted as the alias `"ggmModSelect"`) and self-certified by the constrained-MLE stationarity residual. ```{r} ms <- psychnet(SRL_GPT, method = "ggm") ms certificate(ms) ``` ## Regularized vs unregularized Because it does not shrink, the stepwise GGM's retained edges are larger in magnitude than the lasso's on the same data. Compare the two edge lists: ```{r} as.data.frame(psychnet(SRL_GPT, method = "glasso")) # shrunk as.data.frame(ms) # unshrunk ``` The default `gamma` is `0` (plain BIC), matching `qgraph::ggmModSelect()` -- the unregularized refit does not need the extra EBIC penalty. ## Predictability ```{r} net_predict(ms) ``` ## Plotting Pass the network object to `cograph::splot()` with `psych_styling = TRUE` (spring layout, green = positive, red = negative). For a non-glasso network ask for the predictability ring explicitly with `predictability = TRUE`. ```{r ggmms-plot, eval = has_cograph} cograph::splot(ms, psych_styling = TRUE, predictability = TRUE) ``` See `net_crosswalk("ggmModSelect")` for the argument map against `qgraph`.