generate_fit_only: Simulating networks from the Caldarelli model

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/generate_fit_only.R

Description

This function generates networks from the Caldarelli model. In this model, the preferential attachment function is constant, i.e. A_k = 1, and node fitnesses are sampled from some probability distribution.

Usage

1
2
3
4
5
6
generate_fit_only(N             = 1000   , 
                 num_seed       = 2      , 
                 multiple_node  = 1      , 
                 m              = 1      ,
                 mode_f         = "gamma", 
                 s              = 10     )

Arguments

The parameters can be divided into two 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.

m

Positive integer. The number of edges of each new node. 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".

s

Non-negative numeric. The inverse variance parameter. The mean of the distribution is kept at 1 and the variance is 1/s (since node fitnesses are only meaningful up to scale). This is achieved by setting shape and rate parameters of the Gamma distribution to s; setting mean and standard deviation in log-scale of the log-normal distribution to -1/2*log (1/s + 1) and (log (1/s + 1))^{0.5}; and setting shape and scale parameters of the pareto distribution to (s+1)^{0.5} + 1 and (s+1)^{0.5}/((s+1)^{0.5} + 1). If s is 0, all node fitnesses η are fixed at 1 (i.e., Barabási-Albert model). The default value is 10.

Value

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 (from_id, to_id, time_stamp). from_id is the id of the source, to_id is the id of the destination.

type

a string indicates whether the network is "directed" or "undirected".

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.

Author(s)

Thong Pham thongphamthe@gmail.com

References

1. Caldarelli, G., Capocci, A. , De Los Rios, P. & Muñoz, M.A. (2002). Scale-Free Networks from Varying Vertex Intrinsic Fitness. Phys. Rev. Lett., 89, 258702 (doi: 10.1103/PhysRevLett.89.258702).

See Also

For subsequent estimation procedures, see get_statistics.

For other functions to generate networks, see generate_net, generate_BA, generate_ER and generate_BB.

Examples

1
2
3
4
5
6
  library("PAFit")
  # generate a network from the Caldarelli model with alpha = 1, N = 100, m = 1
  # the inverse variance of distribution of node fitnesses is s = 10
  net <- generate_fit_only(N = 100,m = 1,mode = 1, s = 10)
  str(net)
  plot(net)

Example output

List of 4
 $ graph  : num [1:98, 1:3] 2 3 4 5 6 7 8 9 10 11 ...
 $ fitness: Named num [1:100] 0.886 1.057 0.798 1.577 0.805 ...
  ..- attr(*, "names")= chr [1:100] "1" "2" "3" "4" ...
 $ PA     : num [1:9] 1 1 1 1 1 1 1 1 1
 $ type   : chr "directed"
 - attr(*, "class")= chr "PAFit_net"

PAFit documentation built on Jan. 18, 2022, 1:10 a.m.