Bug fix with sapply

This commit is contained in:
Niclas
2026-01-20 15:13:06 +01:00
parent 85960de4d4
commit 16a1405f16

View File

@@ -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)