Usage
PAFit (data, only_PA = FALSE, only_f = FALSE, mode_f = c("Linear_PA", "Constant_PA","Log_linear"), true_A = NULL, true_f = NULL, s = 1, auto_lambda = TRUE, r = 0.01, lambda = 1, weight_PA_mode = 1, auto_stop = TRUE, stop_cond = 10^-6, iteration = 20, max_iter = 1000, debug = FALSE, alpha_start = 1, normalized_f = FALSE, interpolate = TRUE, ...)
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 $\eta_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$ for $k \ge 1$ and $A_0 = C$. If mode_f == "Constant_PA" then $A_k = 1$ for all $k$. If mode_f == "Log_linear" then $A_k = k^\alpha$ for $k \ge 1$ and $A_0 = C$. The values of $\alpha$ and $C$ are estimated by MLE. Default values is "Linear_PA".
true_A
Numeric vector. If the true_A is supplemented, then only fitness is estimated.
true_f
Numeric vector. If the true_f is supplemented, then only PA is estimated.
s
Numeric. The regularization parameter $s$ for node fitness. Default value is $1$.
auto_lambda
Logical. If auto_lambda == TRUE, lambda will be determined automatically from the data. Default is TRUE.
r
Numeric. The regularization parameter $r$ for the PA function. Default value is $0.01$.
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(h(ii) - h(ii + 1)) / (abs(h(ii)) + 1) < stop_cond$ where $h(ii)$ is the value of the objective function (posterior probability in log-scale) at iteration $ii$. We recommend to choose stop_cond at most equal to $10^(- number of digits of h - 2)$, in order to ensure that when the algorithm stops, the increase in posterior probability is less than 1% of the current posterior probability. 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 objective function $h$ is printed out at each step. Defaule is FALSE.
alpha_start
Numeric. The starting value for alpha when we use the model $k^\alpha$. 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 the estimated $A_k$. The interpolation, if performed, is a linear regression on log-scale. Default value is TRUE.