R Under development (unstable) (2024-03-25 r86192 ucrt) -- "Unsuffered Consequences" 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: 177 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.5309231 Attachment exponent ± 2 s.d. : (0.4307477,0.6310986) Containing the estimated attachment function. Number of bins: 10 Estimated attachment exponent: 0.5309231 Attachment exponent ± 2 s.d.: (0.4307477,0.6310986) Containing the estimated attachment function. Number of bins: 10 Estimated attachment exponent: 0.5309231 Attachment exponent ± 2 s.d. : (0.4307477,0.6310986) Containing the estimated attachment function. Number of bins: 10 Estimated attachment exponent: 0.5309231 Attachment exponent ± 2 s.d.: (0.4307477,0.6310986) > 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: 177 Number of bins: 178 > 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: 178 Estimated attachment exponent: 0.4745469 Attachment exponent ± 2 s.d. : (0.2598092,0.6892846) Containing the estimated attachment function. Number of bins: 178 Estimated attachment exponent: 0.4745469 Attachment exponent ± 2 s.d.: (0.2598092,0.6892846) Containing the estimated attachment function. Number of bins: 178 Estimated attachment exponent: 0.4745469 Attachment exponent ± 2 s.d. : (0.2598092,0.6892846) Containing the estimated attachment function. Number of bins: 178 Estimated attachment exponent: 0.4745469 Attachment exponent ± 2 s.d.: (0.2598092,0.6892846) > > > proc.time() user system elapsed 2.03 0.29 2.31