R version 4.4.0 alpha (2024-03-26 r86209 ucrt) Copyright (C) 2024 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 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. > #testing generate_net, get_statistics, Jeong, Newman_corrected and PAFit > > library(PAFit) > for (prob_m in c("TRUE", "FALSE")) + for (inc in c("TRUE","FALSE")) + for (log in c("TRUE", "FALSE")) + + for (i in 1:3) { + net <- generate_net(N = 50, m = 10,prob_m = prob_m, increase = inc, log = log, + mode = i, s = 10) + for (bin in c("TRUE","FALSE")) + + for (deg_thresh in c(0)) { + net_stats <- get_statistics(net,deg_threshold = deg_thresh, binning = bin, g = 10) + #check stats + if (sum(net_stats$m_t) != sum(net_stats$sum_m_k)) + stop("wrong at m_t and sum_m_k") + if (sum(abs(colSums(net_stats$m_tk) - net_stats$sum_m_k)) != 0) + stop("wrong at m_tk and sum_m_k") + temp <- sapply(1:(net_stats$T-1),function(x) sum(net_stats$node_degree[x,] != -1)) + if (sum(abs(rowSums(net_stats$n_tk) - (rowSums(net_stats$offset_tk) + temp)))) + stop("wrong at node_degree, n_tk, offset_tk") + if (sum(net_stats$z_j) > sum(net_stats$m_t)) + stop("wrong at z_j") + if (sum(net_stats$z_j) + sum(net_stats$offset_m_tk) - sum(net_stats$sum_m_k)) + stop("Wrong at offset_m_tk") + net_stats <- get_statistics(net,deg_threshold = deg_thresh, binning = bin, g = 10,only_PA = TRUE) + net_stats <- get_statistics(net,deg_threshold = deg_thresh, binning = bin, g = 10,only_true_deg_matrix = TRUE) + } + } > net_stats <- get_statistics(net,deg_threshold = deg_thresh, binning = TRUE, g = 10) > print(net_stats) Contains summary statistics for the temporal network. > summary(net_stats) Contains summary statistics for the temporal network. Type of network: directed Number of nodes in the final network: 50 Number of edges in the final network: 480 Number of new nodes: 49 Number of new edges: 479 Number of time-steps: 49 Maximum in-degree: 131 Number of bins: 10 > for (mode_f_value in c("Constant_PA", "Log_linear")) { + result_Jeong <- Jeong(net,net_stats, T_0_start = 0, T_0_end = 20, T_1_start = 30 , T_1_end = 40) + result_Jeong <- Jeong(net,net_stats, T_0_start = 0, T_0_end = 20, T_1_start = 30 , T_1_end = 40, interpolate = TRUE) + print(result_Jeong) + summary(result_Jeong) + plot(result_Jeong,net_stats) + plot(result_Jeong,net_stats, line = TRUE) + plot(result_Jeong,net_stats, high_deg = 5) + result_Newman <- Newman(net, net_stats) + result_Newman <- Newman(net, net_stats, interpolate = TRUE) + + } Containing the estimated attachment function. Number of bins: 10 Estimated attachment exponent: 0.3508132 Attachment exponent ± 2 s.d. : (-0.1049892,0.8066156) Containing the estimated attachment function. Number of bins: 10 Estimated attachment exponent: 0.3508132 Attachment exponent ± 2 s.d.: (-0.1049892,0.8066156) Containing the estimated attachment function. Number of bins: 10 Estimated attachment exponent: 0.3508132 Attachment exponent ± 2 s.d. : (-0.1049892,0.8066156) Containing the estimated attachment function. Number of bins: 10 Estimated attachment exponent: 0.3508132 Attachment exponent ± 2 s.d.: (-0.1049892,0.8066156) > net_stats <- get_statistics(net,deg_threshold = deg_thresh, binning = FALSE, g = 10) > print(net_stats) Contains summary statistics for the temporal network. > summary(net_stats) Contains summary statistics for the temporal network. Type of network: directed Number of nodes in the final network: 50 Number of edges in the final network: 480 Number of new nodes: 49 Number of new edges: 479 Number of time-steps: 49 Maximum in-degree: 131 Number of bins: 132 > for (mode_f_value in c("Constant_PA", "Log_linear")) { + + result_Jeong <- Jeong(net,net_stats, T_0_start = 0, T_0_end = 20, T_1_start = 30 , T_1_end = 40) + result_Jeong <- Jeong(net,net_stats, T_0_start = 0, T_0_end = 20, T_1_start = 30 , T_1_end = 40, interpolate = TRUE) + print(result_Jeong) + summary(result_Jeong) + plot(result_Jeong,net_stats) + plot(result_Jeong,net_stats, line = TRUE) + plot(result_Jeong,net_stats, high_deg = 5) + result_Newman <- Newman(net, net_stats) + result_Newman <- Newman(net, net_stats, interpolate = TRUE) + } Containing the estimated attachment function. Number of bins: 132 Estimated attachment exponent: 0.3741427 Attachment exponent ± 2 s.d. : (-0.06417573,0.8124611) Containing the estimated attachment function. Number of bins: 132 Estimated attachment exponent: 0.3741427 Attachment exponent ± 2 s.d.: (-0.06417573,0.8124611) Containing the estimated attachment function. Number of bins: 132 Estimated attachment exponent: 0.3741427 Attachment exponent ± 2 s.d. : (-0.06417573,0.8124611) Containing the estimated attachment function. Number of bins: 132 Estimated attachment exponent: 0.3741427 Attachment exponent ± 2 s.d.: (-0.06417573,0.8124611) > > > proc.time() user system elapsed 3.10 0.56 3.65