Last data update: 2014.03.03

R: A function to estimate the attachment function and node...
PAFitR Documentation

A function to estimate the attachment function and node fitness in temporal complex networks

Description

From a PAFitData object, which contains summary statistics summerized from the dataset, PAFit estimates the attachment function A_k and node fitness f_i by penalized log-likelihood maximization. It also calculates confidence intervals for A_k and f_i. Estimation of the attachment function in isolation (while fixing f_i = 1) can be specified by setting only_PA = TRUE. Estimation of node fitness in isolation (fixing either A_k = k or A_k = 1) can be specified by setting only_f = TRUE.

Usage

PAFit(data, only_PA , only_f, mode_f, true_A, true_f,
shape, rate, auto_lambda, ratio, lambda, weight_PA_mode, auto_stop, stop_cond,
iteration , max_iter, debug , step_size, q , normalized_f, interpolate,...)

Arguments

data

An object of class "PAFitData" containing all the summary statistics summerized from the data by the function GetStatistics

only_PA

Logical. TRUE means that the attachment function A_k is estimated in isolation(fixing f_i = 1). Default is FALSE.

only_f

Logical. TRUE means that the fitness function is estimated in isolation. Default is FALSE.

mode_f

String. Only effective when only_f == TRUE. If mode_f == "Linear_PA" then A_k = k. If mode_f == "Constant_PA" then A_k = 1. Default values is "Linear_PA".

true_A
true_f
shape

Numeric. The shape parameter in the Gamma prior for f_i. Default value is 0.1.

rate

Numeric. The rate parameter in the Gamma prior for f_i. Default value is 0.1. Either Shape == 0 or Rate == 0 means no regularization for f_i.

auto_lambda

Logical. If auto_lambda == TRUE, lambda will be determined automatically from the data. Default is TRUE.

ratio

Numeric. The ratio between strength of the regularization term and the total number of data. Default is 0.

lambda

Numeric. The strength of the regularization for PA function. Ignored when auto_lambda == TRUE. Default value is 1. lambda == 0 means no regularization for A.

weight_PA_mode

Integer. Indicates how the regularization terms for A_k are weighted. If weight_PA_mode == 0, the regularization term for A_k is weighted by the total number of edges connected to degree k nodes. If weight_PA_mode == 1, the regularization terms have uniform weights. Default value is 0.

auto_stop

Logical. Indicates whether the algorithm stop automatically or not. Default is TRUE

stop_cond

Numeric. If auto_stop = TRUE, the iterative algorithm stops when abs(l(i) - l(i+1)/l(i)) < stop_cond. Default is 10^-4.

iteration

Numeric. The number of iterations. Ignored if auto_stop == TRUE. Default value is 20.

max_iter

Numeric. The maximum number of iterations. Regardless of other settings, the algorithm will stop once the number of iterations reaches this threshold. Default value is 1000.

debug

Logical. if debug == TRUE, the value of the log likelihood function is printed out at each step. Defaule is FALSE.

step_size

Numeric. A numeric value between 0 and 1. Determines the convex combination of the default direction given by the MM update and the quasi-Newton direction. Only effective if q ≥ 2. step_size = 1 means we ignore the default MM direction. Default value is 1.

q

Integer. The number of previous values used in the quasi-Newton acceleration of Zhou et al. A quasi-newton acceleration for high-dimensional optimization algorithms (2011). The acceleration is activated only when q ≥ 2. Default value is 1.

normalized_f

Logical. Indicates whether we should normalize the estimated value of f after estimation. Default value is FALSE.

interpolate

Logical. Indicates whether we should perform interpolation for the missing values of A_k. Default value is FALSE.

...

Value

an object of class "PAFit", which is a list. Some important fields of this object:

A

The estimated attachment function

k

The corresponding degree

var_A

Variances of the estimated A

linear_fit

Result of fitting the log-linear model log A_k = α log k to the estimated A_k

alpha

The estimated attachment exponent of the log-linear model A_k =k^α

weight_of_A

The number of A in each bin

var_logA

Variances of log(A)

upper_A

The upper value of the 2-sigma confidence interval of A

lower_A

The lower value of the 2-sigma confidence interval of A

center_k

The logarithmic center of the bins

theta

Attachment value of the bins (before converting back to A_k)

upper_bin

The upper value of the 2-sigma confidence interval of theta

lower_bin

The lower value of the 2-sigma confidence interval of theta

f

The estimated node fitness

var_f

Variances of the estimated f

upper_f

The upper value of the 2-sigma confidence interval of f

lower_f

The lower value of the 2-sigma confidence interval of f

log_likelihood

Values of the (penalized) log-likelihood function recorded at each iteration

Author(s)

Thong Pham thongpham@thongpham.net

References

1. Pham, T. and Sheridan, P. and Shimodaira, H. (2015). Nonparametric estimation of the preferential attachment function in complex networks: evidence of deviations from log linearity, in press. Proceedings of ECCS 2014: European Conference on Complex Systems.

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)

Examples

library("PAFit")
data   <- GenerateNet(N = 1000,m = 1, mode = 1, alpha = 1, shape = 5, rate = 5)
stats  <- GetStatistics(data$graph)
result <- PAFit(stats)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(PAFit)
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/PAFit/PAFit.Rd_%03d_medium.png", width=480, height=480)
> ### Name: PAFit
> ### Title: A function to estimate the attachment function and node fitness
> ###   in temporal complex networks
> ### Aliases: PAFit
> ### Keywords: package fitness model Preferential Attachment function
> ###   Minorize-Maximization algorithms Barabasi-Albert model MM algorithims
> ###   Bianconi-Barabasi model fitness maximum likelihood function
> 
> ### ** Examples
> 
> library("PAFit")
> data   <- GenerateNet(N = 1000,m = 1, mode = 1, alpha = 1, shape = 5, rate = 5)
> stats  <- GetStatistics(data$graph)
> result <- PAFit(stats)
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>