diff --git a/R/graphon_distribution.R b/R/graphon_distribution.R index 9587847..5bf76bb 100644 --- a/R/graphon_distribution.R +++ b/R/graphon_distribution.R @@ -67,8 +67,7 @@ pgraphon <- function( dev_mat <- outer(y, inner_products, "-") # Apply CDF Fv to each deviation - # With sapply we do not have to assume that Fv is vectorized - cdf_values <- sapply(dev_mat, Fv) + cdf_vals <- Fv(dev_mat) # Row means give the empirical expectation for each y_j out <- rowMeans(cdf_vals) @@ -140,8 +139,7 @@ dgraphon <- function( dev_mat <- outer(y, inner_products, "-") # Apply the density function to each y[j] - # With sapply we do not have to assume that fv is vectorized - dens_vals <- sapply(dev_mat, fv) + dens_vals <- fv(dev_mat) # Row means give the empirical expectation for each y_j out <- rowMeans(dens_vals)