{infernet} is the inferential layer of the
stocnet ecosystem. It offers two things:
- Tests of network statistics.
test_random()runs a conditional uniform graph (CUG) test,test_configuration()conditions on the degree sequence, andtest_permutation()runs a quadratic assignment procedure (QAP) test. Each takes any graph-level statistic and compares it against a simulated null distribution. - Network regression.
net_regression()fits a multiple regression quadratic assignment procedure (MRQAP) model, using either Dekker et al’s double semi-partialling or a permutation of the dependent network alone.
The package combines the formula interface of {migraph} with the
estimators, missing-data handling, and cognitive social structure
treatment of Robert Krause’s MrQAP.
{infernet} and the other stocnet
packages aim for three things:
- Declarative simplicity: functions do one clearly named thing with
few arguments. For example,
test_permutation()andnet_regression()are named for what they do, rather than for an acronym. - Pleasant predictability: users can guess a function’s behaviour
from its family. For example, the
test_*()functions all take a network, a statistic, and a number oftimes. - Graceful inclusivity: functions accept whatever network users
bring and return something they can use. For example,
net_regression()works on any network that{manynet}can convert, one-mode or two-mode, and keeps missing data missing.
See the contributing guide for how these principles translate into rules for the package.
Models are specified with a formula, so the same specification can be moved between networks and between model types:
library(infernet)
networkers <- manynet::ison_networkers |>
manynet::to_subgraph(Discipline == "Sociology")
net_regression(weight ~ ego(Citations) + alter(Citations) + sim(Citations),
networkers, times = 200)Alongside plain references to other networks, which enter as dyadic covariates, the right-hand side accepts:
| Term | Constructs a matrix of |
|---|---|
ego(attr) |
the sender’s value of a nodal attribute |
alter(attr) |
the receiver’s value |
same(attr) |
1 where sender and receiver share an attribute value |
dist(attr) |
the absolute difference in a numeric attribute |
sim(attr) |
the proportional similarity in a numeric attribute |
tertius(attr, fn) |
an aggregate of an attribute over a node’s other ties |
Further options are passed through a control list: the model family,
the null hypothesis, random or fixed effects, robust standard errors,
the parallel strategy, and an optional {torch} path for running
permutations on a GPU.
{infernet} is not yet on CRAN. The latest binary releases for all
major OSes – Windows, Mac, and Linux – can be found
here. Download
the appropriate binary for your operating system, and install using an
adapted version of the following commands:
- For Windows:
install.packages("~/Downloads/infernet_winOS.zip", repos = NULL) - For Mac:
install.packages("~/Downloads/infernet_macOS.tgz", repos = NULL) - For Unix:
install.packages("~/Downloads/infernet_linuxOS.tar.gz", repos = NULL)
To install from source, please install the {remotes} package from CRAN
and then:
- For latest stable version:
remotes::install_github("stocnet/infernet") - For latest development version:
remotes::install_github("stocnet/infernet@develop")
Development on this package has been funded by the Swiss National Science Foundation (SNSF) Grant Number 188976: “Power and Networks and the Rate of Change in Institutional Complexes” (PANARCHIC).
