generate_network_P {localboot}R Documentation

Generate Network Adjacency Matrix from Probability Matrix

Description

This function generates a network adjacency matrix from a given probability matrix. It checks if the input is a valid probability matrix and can produce either a single network or multiple replicates.

Usage

generate_network_P(P, replicate = 1, symmetric.out = TRUE, noloop = FALSE)

Arguments

P

A square matrix representing the probability matrix, where each element is a probability (between 0 and 1) of an edge between nodes.

replicate

An integer indicating the number of network replicates to generate. Defaults to 1.

symmetric.out

A logical value indicating whether the output matrix should be symmetric. Defaults to TRUE.

noloop

A logical value indicating whether to include self-loops in the network. Defaults to FALSE.

Value

If 'replicate' is 1, returns a single adjacency matrix. If 'replicate' is greater than 1, returns a list of adjacency matrices. Each matrix is a square binary matrix, where 1 indicates the presence of an edge and 0 indicates its absence.

Examples

P = generate_graphon(100, 1)
network = generate_network_P(P, replicate = 1, symmetric.out = TRUE)


[Package localboot version 0.9.2 Index]