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. > library(PAFit) > > net <- generate_net(N = 100, m = 10,prob_m = TRUE, increase = TRUE, log = TRUE, multiple_node = 5, + mode = 1, s = 100) > > for (bin in c("FALSE","TRUE")) { + deg_thresh <- 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 <- generate_net(N = 50, m = 10,prob_m = TRUE, increase = TRUE, log = TRUE, + mode = 1, s = 100) > > temp <- net$graph[,2] > net$graph[,2] <- net$graph[,1] > net$graph[,1] <- temp > > for (bin in c("FALSE","TRUE")) { + deg_thresh <- 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$graph[,1] <- rev(net$graph[,1]) > > for (bin in c("FALSE","TRUE")) { + deg_thresh <- 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$graph[,1] <- rev(net$graph[,1]) > net$graph[,2] <- rev(net$graph[,2]) > > for (bin in c("FALSE","TRUE")) { + deg_thresh <- 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") + } > > > > > proc.time() user system elapsed 1.34 0.23 1.53