Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

ergm.geodistdist

Calculate geodesic distance distribution for a network or edgelist


Description

ergm.geodistdist calculates geodesic distance distribution for a given network and returns it as a vector.

ergm.geodistn calculates geodesic deistance distribution based on an input edgelist, and has very little error checking so should not normally be called by users. The C code requires the edgelist to be directed and sorted correctly.

Usage

ergm.geodistdist(nw, directed = is.directed(nw))

ergm.geodistn(edgelist, n = max(edgelist), directed = FALSE)

Arguments

nw

network object over which distances should be calculated

directed

logical, should the network be treated as directed

edgelist

an edgelist representation of a network as an mx2 matrix

n

integer, size of the network

Details

ergm.geodistdist is a network wrapper for ergm.geodistn, which calculates and returns the geodesic distance distribution for a given network via full_geodesic_distribution.C

Value

a vector ans with length equal to the size of the network where

  • ans[i], i=1, ..., n-1 is the number of pairs of geodesic length i

  • ans[n] is the number of pairs of geodesic length infinity.

See Also

See also the sna package geodist function

Examples

data(faux.mesa.high)
ergm.geodistdist(faux.mesa.high)

ergm

Fit, Simulate and Diagnose Exponential-Family Models for Networks

v3.11.0
GPL-3 + file LICENSE
Authors
Mark S. Handcock [aut], David R. Hunter [aut], Carter T. Butts [aut], Steven M. Goodreau [aut], Pavel N. Krivitsky [aut, cre] (<https://orcid.org/0000-0002-9101-3362>), Martina Morris [aut], Li Wang [ctb], Kirk Li [ctb], Skye Bender-deMoll [ctb], Chad Klumb [ctb], Michał Bojanowski [ctb], Ben Bolker [ctb]
Initial release
2020-10-14

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.