Calculate network statistic and covariance matrix.

Share:

Description

Calculate network statistic and covariance matrix, which is based on a multinomial distribution. Each unit (either node or edge) in the network is assumed to be sampled from a multinomial distribution based on probabilities associated with the network statistic.

Usage

1
2
3
4
5
6
NS_Multinomial(g,
		   Network_stats, 
		   mean_inflate = 0, 
		   var_inflate = 1,
		   covPattern = NULL
		 )

Arguments

g

a network object.

Network_stats

Either 'DegreeDist' or 'DegMixing'.

mean_inflate

Add small amount to remove zero values from degree mixing matrix entries.

var_inflate

Multiply the variance by a constant. Used to avoid signular covariance matrices.

covPattern

Currently not used.

Value

A list of length 2 containing:

Network Statistic

Network statistic of the inputted network.

Covariance

Covariance matrix for the network statistic; assumes each unit (either node or edge) is sampled from a multinomial distribution based on probabilities derived from the network statistic.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
g = as.network(rgraph(n=500, m=1, tprob=.01, 
		           mode='graph', diag=FALSE,
                     replace=FALSE, tielist=NULL, 
                     return.as.edgelist=FALSE),
               directed = FALSE)

Prob_Distr_Params=list(NS_Multinomial(g,
				  Network_stats = 'DegreeDist',
                       mean_inflate = .05, 
                       var_inflate = 1.05))

Prob_Distr_Params=list(NS_Multinomial(g,
                       Network_stats = 'DegMixing',
                       mean_inflate = .05, 
                       var_inflate = 1.05))