get_centrality: Compute Centrality Measures

View source: R/centrality.R

get_centralityR Documentation

Compute Centrality Measures

Description

This function computes various network centrality measures for a given GVAR fit object. Centrality measures describe the "connectedness" of a variable in a network, while density describes the networks' overall connectedness. Specifically, it computes the in-strength, out-strength, contemporaneous strength, temporal network density, and contemporaneous network density. The result can then be visualized using plot_centrality.

Usage

get_centrality(fitobj, burnin = 0, remove_ar = TRUE)

Arguments

fitobj

Fitted model object for a Bayesian GVAR model. This can be 'tsnet_fit' object (obtained from stan_gvar, a BGGM object (obtained from var_estimate in BGGM), or extracted posterior samples (obtained from stan_fit_convert).

burnin

An integer specifying the number of initial samples to discard as burn-in. Default is 0.

remove_ar

A logical value specifying whether to remove the autoregressive effects for centrality calculation. Default is TRUE. This is only relevant for the calculation of temporal centrality/density measures.

Value

A list containing the following centrality measures:

  • instrength: In-strength centrality.

  • outstrength: Out-strength centrality.

  • strength: Contemporaneous strength centrality.

  • density_beta: Temporal network density.

  • density_pcor: Contemporaneous network density.

Examples

 # Use first individual from example fit data from tsnet
 data(fit_data)
 centrality_measures <- get_centrality(fit_data[[1]])


tsnet documentation built on June 20, 2025, 9:08 a.m.