File: sample_pa_age.Rd

package info (click to toggle)
r-cran-igraph 2.1.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 27,044 kB
  • sloc: ansic: 204,981; cpp: 21,711; fortran: 4,090; yacc: 1,229; lex: 519; sh: 52; makefile: 8
file content (169 lines) | stat: -rw-r--r-- 6,477 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/games.R
\name{sample_pa_age}
\alias{sample_pa_age}
\alias{pa_age}
\title{Generate an evolving random graph with preferential attachment and aging}
\usage{
sample_pa_age(
  n,
  pa.exp,
  aging.exp,
  m = NULL,
  aging.bin = 300,
  out.dist = NULL,
  out.seq = NULL,
  out.pref = FALSE,
  directed = TRUE,
  zero.deg.appeal = 1,
  zero.age.appeal = 0,
  deg.coef = 1,
  age.coef = 1,
  time.window = NULL
)

pa_age(...)
}
\arguments{
\item{n}{The number of vertices in the graph.}

\item{pa.exp}{The preferential attachment exponent, see the details below.}

\item{aging.exp}{The exponent of the aging, usually a non-positive number,
see details below.}

\item{m}{The number of edges each new vertex creates (except the very first
vertex). This argument is used only if both the \code{out.dist} and
\code{out.seq} arguments are NULL.}

\item{aging.bin}{The number of bins to use for measuring the age of
vertices, see details below.}

\item{out.dist}{The discrete distribution to generate the number of edges to
add in each time step if \code{out.seq} is NULL. See details below.}

\item{out.seq}{The number of edges to add in each time step, a vector
containing as many elements as the number of vertices. See details below.}

\item{out.pref}{Logical constant, whether to include edges not initiated by
the vertex as a basis of preferential attachment. See details below.}

\item{directed}{Logical constant, whether to generate a directed graph. See
details below.}

\item{zero.deg.appeal}{The degree-dependent part of the
\sQuote{attractiveness} of the vertices with no adjacent edges. See also
details below.}

\item{zero.age.appeal}{The age-dependent part of the \sQuote{attrativeness}
of the vertices with age zero. It is usually zero, see details below.}

\item{deg.coef}{The coefficient of the degree-dependent
\sQuote{attractiveness}. See details below.}

\item{age.coef}{The coefficient of the age-dependent part of the
\sQuote{attractiveness}. See details below.}

\item{time.window}{Integer constant, if NULL only adjacent added in the last
\code{time.windows} time steps are counted as a basis of the preferential
attachment. See also details below.}

\item{...}{Passed to \code{sample_pa_age()}.}
}
\value{
A new graph.
}
\description{
This function creates a random graph by simulating its evolution. Each time
a new vertex is added it creates a number of links to old vertices and the
probability that an old vertex is cited depends on its in-degree
(preferential attachment) and age.
}
\details{
This is a discrete time step model of a growing graph. We start with a
network containing a single vertex (and no edges) in the first time step.
Then in each time step (starting with the second) a new vertex is added and
it initiates a number of edges to the old vertices in the network. The
probability that an old vertex is connected to is proportional to
\deqn{P[i] \sim (c\cdot k_i^\alpha+a)(d\cdot l_i^\beta+b)}.

Here \eqn{k_i}{k[i]} is the in-degree of vertex \eqn{i} in the current time
step and \eqn{l_i}{l[i]} is the age of vertex \eqn{i}. The age is simply
defined as the number of time steps passed since the vertex is added, with
the extension that vertex age is divided to be in \code{aging.bin} bins.

\eqn{c}, \eqn{\alpha}{alpha}, \eqn{a}, \eqn{d}, \eqn{\beta}{beta} and
\eqn{b} are parameters and they can be set via the following arguments:
\code{pa.exp} (\eqn{\alpha}{alpha}, mandatory argument), \code{aging.exp}
(\eqn{\beta}{beta}, mandatory argument), \code{zero.deg.appeal} (\eqn{a},
optional, the default value is 1), \code{zero.age.appeal} (\eqn{b},
optional, the default is 0), \code{deg.coef} (\eqn{c}, optional, the default
is 1), and \code{age.coef} (\eqn{d}, optional, the default is 1).

The number of edges initiated in each time step is governed by the \code{m},
\code{out.seq} and \code{out.pref} parameters. If \code{out.seq} is given
then it is interpreted as a vector giving the number of edges to be added in
each time step. It should be of length \code{n} (the number of vertices),
and its first element will be ignored. If \code{out.seq} is not given (or
NULL) and \code{out.dist} is given then it will be used as a discrete
probability distribution to generate the number of edges. Its first element
gives the probability that zero edges are added at a time step, the second
element is the probability that one edge is added, etc. (\code{out.seq}
should contain non-negative numbers, but if they don't sum up to 1, they
will be normalized to sum up to 1. This behavior is similar to the
\code{prob} argument of the \code{sample} command.)

By default a directed graph is generated, but it \code{directed} is set to
\code{FALSE} then an undirected is created. Even if an undirected graph is
generated \eqn{k_i}{k[i]} denotes only the adjacent edges not initiated by
the vertex itself except if \code{out.pref} is set to \code{TRUE}.

If the \code{time.window} argument is given (and not NULL) then
\eqn{k_i}{k[i]} means only the adjacent edges added in the previous
\code{time.window} time steps.

This function might generate graphs with multiple edges.
}
\examples{

# The maximum degree for graph with different aging exponents
g1 <- sample_pa_age(10000, pa.exp = 1, aging.exp = 0, aging.bin = 1000)
g2 <- sample_pa_age(10000, pa.exp = 1, aging.exp = -1, aging.bin = 1000)
g3 <- sample_pa_age(10000, pa.exp = 1, aging.exp = -3, aging.bin = 1000)
max(degree(g1))
max(degree(g2))
max(degree(g3))
}
\seealso{
Random graph models (games)
\code{\link{erdos.renyi.game}()},
\code{\link{sample_}()},
\code{\link{sample_bipartite}()},
\code{\link{sample_chung_lu}()},
\code{\link{sample_correlated_gnp}()},
\code{\link{sample_correlated_gnp_pair}()},
\code{\link{sample_degseq}()},
\code{\link{sample_dot_product}()},
\code{\link{sample_fitness}()},
\code{\link{sample_fitness_pl}()},
\code{\link{sample_forestfire}()},
\code{\link{sample_gnm}()},
\code{\link{sample_gnp}()},
\code{\link{sample_grg}()},
\code{\link{sample_growing}()},
\code{\link{sample_hierarchical_sbm}()},
\code{\link{sample_islands}()},
\code{\link{sample_k_regular}()},
\code{\link{sample_last_cit}()},
\code{\link{sample_pa}()},
\code{\link{sample_pref}()},
\code{\link{sample_sbm}()},
\code{\link{sample_smallworld}()},
\code{\link{sample_traits_callaway}()},
\code{\link{sample_tree}()}
}
\author{
Gabor Csardi \email{csardi.gabor@gmail.com}
}
\concept{games}
\keyword{graphs}