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(...)
out.dist and
out.seq arguments are NULL.out.seq is NULL. See details below.time.windows time steps are counted as a basis of the preferential
attachment. See also details below.sample_pa_age.Here $k_i$ is the in-degree of vertex $i$ in the current time
step and $l_i$ is the age of vertex $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 aging.bin bins.
$c$, $\alpha$, $a$, $d$, $\beta$ and
$b$ are parameters and they can be set via the following arguments:
pa.exp ($\alpha$, mandatory argument), aging.exp
($\beta$, mandatory argument), zero.deg.appeal ($a$,
optional, the default value is 1), zero.age.appeal ($b$,
optional, the default is 0), deg.coef ($c$, optional, the default
is 1), and age.coef ($d$, optional, the default is 1).
The number of edges initiated in each time step is governed by the m,
out.seq and out.pref parameters. If 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 n (the number of vertices),
and its first element will be ignored. If out.seq is not given (or
NULL) and 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. (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
prob argument of the sample command.)
By default a directed graph is generated, but it directed is set to
FALSE then an undirected is created. Even if an undirected graph is
generaed $k_i$ denotes only the adjacent edges not initiated by
the vertex itself except if out.pref is set to TRUE.
If the time.window argument is given (and not NULL) then
$k_i$ means only the adjacent edges added in the previous
time.window time steps.
This function might generate graphs with multiple edges.
sample_pa, sample_gnp# 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))Run the code above in your browser using DataLab