GenerateNet: Simulating networks from preferential attachment and fitness...

Description Usage Arguments Value Author(s) References Examples

Description

This function generates networks from the General Temporal model, a generative temporal network model that includes many well-known models such as the Barabasi-Albert model or the fitness model as special cases. The number of edges of the new node at each time-step can be specified to be fixed, or followed a Poisson distribution. In the latter case, the mean of the Poisson distribution is either held fixed or increased with time.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
GenerateNet (N, 
             num_seed       = 2      , 
             multiple_node  = 1      , 
             specific_start = NULL   ,
             m              = 1      ,
             prob_m         = FALSE  ,
             increase       = FALSE  , 
             log            = FALSE  , 
             custom_PA      = NULL   ,
             mode           = 1      , 
             alpha          = 1      , 
             beta           = 2      , 
             sat_at         = 100    ,
             offset         = 1      ,
             mode_f         = "gamma", 
             rate           = 0      , 
             shape          = 0      , 
             meanlog        = 0      , 
             sdlog          = 1      ,
             scale_pareto   = 2      ,
             shape_pareto   = 2      )

Arguments

The parameters can be divided into four groups.

The first group specifies basic properties of the network:

N

Integer. Total number of nodes in the network (including the nodes in the seed graph). Default value is 1000.

num_seed

Integer. The number of nodes of the seed graph (the initial state of the network). The seed graph is a cycle. Default value is 2.

multiple_node

Positive integer. The number of new nodes at each time-step. Default value is 1.

specific_start

Positive Integer. If specific_start is specified, then all the time-steps from time-step 1 to specific_start are grouped to become the initial time-step in the final output. This option is usefull when we want to create a network with a large initial network that follows a scale-free degree distribution. Default value is NULL.

The second group specifies the number of new edges at each time-step:

m

Positive integer. The number of edges of each new node. Default value is 1.

prob_m

Logical. Indicates whether we fix the number of edges of each new node as a constant, or let it follows a Poisson distribution. If prob_m == TRUE, the number of edges of each new node follows a Poisson distribution. The mean of this distribution depends on the value of increase and log. Default value is FALSE.

increase

Logical. Indicates whether we increase the mean of the Poisson distribution over time. If increase == FALSE, the mean is fixed at m. If increase == TRUE, the way the mean increases depends on the value of log. Default value is FALSE.

log

Logical. Indicates how to increase the mean of the Poisson distribution. If log == TRUE, the mean increases logarithmically with the number of current nodes. If log == FALSE, the mean increases linearly with the number of current nodes. Default value is FALSE.

The third group of parameters specifies the preferential attachment function:

custom_PA

Numeric vector. This is the user-input PA function: A_0,\ A_1,\cdots,\ A_K. If custom_PA is specified, then mode is ignored, and the PA function custom_PA is used to grow the network. Degree greater than K will have attachment value A_k. Default value is NULL.

mode

Integer. Indicates the attachment function to be used in generating the network. If mode == 1, the attachment function is A_k = k^α. If mode == 2, the attachment function is A_k = min(k,sat_at)^α. If mode == 3, the attachment function is A_k = α log (k)^β. Default value is 1.

alpha

Numeric. If mode == 1, this is the attachment exponent in the attachment function A_k = k^α. If mode == 2, this is the attachment exponenet in the attachment function A_k = min(k,sat_at)^α. If mode == 3, this is the α in the attachment function A_k = α log (k)^β + 1.

beta

Numeric. This is the beta in the attachment function A_k = α log (k)^β + 1.

sat_at

Integer. This is the saturation position sat_at in the attachment function A_k = min(k,sat_at)^α.

offset

Numeric. The attachment value of degree 0. Default value is 1.

The final group of parameters specifies the distribution from which node fitnesses are generated:

mode_f

String. Possible values:"gamma", "log_normal" or "power_law". This parameter indicates the true distribution for node fitness. "gamma" = gamma distribution, "log_normal" = log-normal distribution. "power_law" = power-law (pareto) distribution. Default value is "gamma".

rate

Positive numeric. The rate parameter in the Gamma prior for node fitness. If either rate or shape is 0, all node fitnesses η are fixed at 1 (i.e. Barabasi-Albert model)

shape

Positive numeric. The shape parameter in the Gamma prior for node fitness. If either rate or shape is 0, all node fitnesses η are fixed at 1 (i.e. Barabasi-Albert model)

meanlog

Numeric. Mean of the log-normal distribution in log scale. Default value is 0.

sdlog

Positive numeric. Standard deviation of the log-normal distribution in log scale. Default value is 1.

scale_pareto

Numeric. The scale parameter of the Pareto distribution. Default value is 0.6.

shape_pareto

Numeric. The shape parameter of the Pareto distribution. Default value is 2.5.

Value

The output is a List contains the following two fields:

graph

a three-column matrix, where each row contains information of one edge, in the form of (from_id, to_id, time_stamp). from_id is the id of the source, to_id is the id of the destination.

fitness

fitness values of nodes in the network. The name of each value is the ID of the node.

Author(s)

Thong Pham thongpham@thongpham.net

References

1. Pham, T., Sheridan, P. & Shimodaira, H. (2016). Nonparametric Estimation of the Preferential Attachment Function in Complex Networks: Evidence of Deviations from Log Linearity, Proceedings of ECCS 2014, 141-153 (Springer International Publishing) (http://dx.doi.org/10.1007/978-3-319-29228-1_13).

2. Pham, T., Sheridan, P. & Shimodaira, H. (2015). PAFit: A Statistical Method for Measuring Preferential Attachment in Temporal Complex Networks. PLoS ONE 10(9): e0137796. doi:10.1371/journal.pone.0137796 (http://dx.doi.org/10.1371/journal.pone.0137796).

3. Pham, T., Sheridan, P. & Shimodaira, H. (2016). Joint Estimation of Preferential Attachment and Node Fitness in Growing Complex Networks. Scientific Reports 6, Article number: 32558. doi:10.1038/srep32558 (www.nature.com/articles/srep32558).

Examples

1
2
3
4
library("PAFit")
#Generate a network from the original BA model with alpha = 1, N = 100, m = 1
net <- GenerateNet(N = 100,m = 1,mode = 1, alpha = 1, shape = 0)
str(net)


Search within the PAFit package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.