Learn R Programming

PAFit (version 0.7.9)

performCV: A function to perform cross validation.

Description

A function to perform cross validation.

Usage

performCV(cv_data,r = 10^c(-2,-1,0,1,2),s = 10^c(-2,-1,0,1,2), stop_cond = 10^-7, only_PAFit = TRUE, silent = FALSE, only_linear = FALSE)

Arguments

cv_data
Cross-validation data.
r
Numeric vector. Specifying the values of the regularization parameter $r$ of the PA function. Default value is the vector $c(0.01,0.1,1,10,100)$.
s
Numeric vector. Specifying the values of the regularization parameter $s$ of node fitness. Default value is the vector $c(0.01,0.1,1,10,100)$.
stop_cond
Numeric. The iterative algorithm will halt if the relative difference of the objective function falls below this value.
only_PAFit
Logical. If TRUE then only perform the CV for PAFit full model. Default is TRUE.
silent
Logical. If TRUE then the progress is printed. Default is FALSE.
only_linear
Logical. If TRUE then only perform the CV assuming the linear functional form $A_k = k$. Default is FALSE.

Value

References

1. Pham T, Sheridan P, Shimodaira H (2016) Nonparametric Estimation of the Preferential Attachment Function in Complex Networks: Evidence of Deviations from Log Linearity, Proceedings of ECCS 2014, 141-153 (Springer International Publishing) (http://dx.doi.org/10.1007/978-3-319-29228-1_13).

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

Run this code
library("PAFit")
data      <- GenerateNet(N = 100,m = 5,mode = 1, alpha = 1, shape = 5, rate = 5)
data_cv   <- CreateDataCV(data$graph)
cv_result <- performCV(data_cv,r = c(0.1), s = c(5),only_PAFit = TRUE,stop_cond = 10^-3)

Run the code above in your browser using DataLab