generate_net | R Documentation |
This function generates networks from the General Temporal model, a generative temporal network model that includes many well-known models such as the Erdős–Rényi model, the Barabási-Albert model or the Bianconi-Barabási model as special cases. This function also includes some flexible mechanisms to vary the number of new nodes and new edges at each time-step in order to generate realistic networks.
generate_net (N = 1000 ,
num_seed = 2 ,
multiple_node = 1 ,
specific_start = NULL ,
m = 1 ,
prob_m = FALSE ,
increase = FALSE ,
log = FALSE ,
no_new_node_step = 0 ,
m_no_new_node_step = m ,
custom_PA = NULL ,
mode = 1 ,
alpha = 1 ,
beta = 2 ,
sat_at = 100 ,
offset = 1 ,
mode_f = "gamma",
s = 10 )
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 |
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 |
multiple_node |
Positive integer. The number of new nodes at each time-step. Default value is |
specific_start |
Positive Integer. If |
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 |
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 |
increase |
Logical. Indicates whether we increase the mean of the Poisson distribution over time. If |
log |
Logical. Indicates how to increase the mean of the Poisson distribution. If |
no_new_node_step |
Non-negative integer. The number of time-steps in which no new node is added, while new edges are added between existing nodes. Default value is |
m_no_new_node_step |
Positive integer. The number of new edges in the no-new-node steps. Default value is equal to |
The third group of parameters specifies the preferential attachment function:
custom_PA |
Numeric vector. This is the user-input PA function: |
mode |
Integer. Indicates the parametric attachment function to be used in generating the network. If |
alpha |
Numeric. If |
beta |
Numeric. This is the beta in the attachment function |
sat_at |
Integer. This is the saturation position |
offset |
Numeric. The attachment value of degree |
The final group of parameters specifies the distribution from which node fitnesses are generated:
mode_f |
String. Possible values: |
s |
Non-negative numeric. The inverse variance parameter. The mean of the distribution is kept at |
The output is a PAFit_net
object, which is a List contains the following four fields:
graph |
a three-column matrix, where each row contains information of one edge, in the form of |
type |
a string indicates whether the network is |
PA |
a numeric vector contains the true PA function. |
fitness |
fitness values of nodes in the network. The name of each value is the ID of the node. |
Thong Pham thongphamthe@gmail.com
For subsequent estimation procedures, see get_statistics
.
For simpler functions to generate networks from well-known models, see generate_BA
, generate_ER
, generate_BB
and generate_fit_only
.
library("PAFit")
#Generate a network from the original BA model with alpha = 1, N = 100, m = 1
net <- generate_net(N = 100,m = 1,mode = 1, alpha = 1, s = 0)
str(net)
plot(net)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.