dprewire.range {wdnet}R Documentation

Range of assortativity coefficients.

Description

The assortativity coefficient of a given network may not reach all the values between -1 and 1 via degree preserving rewiring. This function calculates the range of assortativity coefficients achievable through degree preserving rewiring. The algorithm is designed for unweighted networks.

Usage

dprewire.range(
  netwk,
  edgelist,
  adj,
  directed,
  which.range = c("outout", "outin", "inout", "inin"),
  control = cvxr_control(),
  target.assortcoef = list(outout = NULL, outin = NULL, inout = NULL, inin = NULL)
)

Arguments

netwk

A wdnet object representing an unweighted network. If NULL, the function will construct a network using either edgelist or adj.

edgelist

A two-column matrix, where each row represents an edge of the network.

adj

An adjacency matrix of an unweighted network.

directed

Logical, whether the network is directed or not. It will be ignored if netwk is provided.

which.range

The type of interested assortativity coefficient. For directed networks, it takes one of the values: "outout", "outin", "inout" and "inin". It will be ignored if the network is undirected.

control

A list of parameters passed to CVXR::solve() for solving an appropriate eta, given the constraints target.assortcoef.

target.assortcoef

A list of constraints, it contains the predetermined value or range imposed on assortativity coefficients other than which.range. It will be ignored if the network is undirected.

Details

The ranges are computed using convex optimization. The optimization problems are defined and solved via the R package CVXR. For undirected networks, the function returns the range of the assortativity coefficient. For directed networks, the function computes the range of which.range while other assortativity coefficients are restricted through target.assortcoef.

Value

Returns the range of the selected assortativity coefficient and the results from the solver.

Examples


set.seed(123)
netwk <- rpanet(5e3,
  control =
    rpa_control_scenario(alpha = 0.5, beta = 0.5)
)
ret1 <- dprewire.range(
  netwk = netwk, which.range = "outin",
  target.assortcoef = list("outout" = c(-0.3, 0.3), "inout" = 0.1)
)
ret1$range



[Package wdnet version 1.2.3 Index]