Learn R Programming

tsnet (version 0.1.0)

get_centrality: 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)

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.

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 [BGGM::var_estimate()]), 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.

Examples

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

Run the code above in your browser using DataLab