A step of the momento_native implementation. No other function in the package calls it. See the file header for the source the module follows. the source it follows.
Examples
set.seed(9)
p <- lapply(1:8, function(i) rnorm(4))
# a naive reconstructor: fill every masked patch with the mean of the visible ones
fill_mean <- function(masked, mask) {
m <- Reduce(`+`, masked[mask == 0]) / sum(mask == 0)
lapply(seq_along(masked), function(i) if (mask[i] == 1) m else masked[[i]])
}
momento_reconstruction_curve(p, fill_mean, rates = c(0.25, 0.5), seed = 1)$mse
#> [1] 0.5409357 1.3209131
