library(perms)
set.seed(1996)
n = 100
t = seq(0, 1, length.out=n)
y = c(rep(0, n/2), rep(1, n/2))
S = 200
X = matrix(runif(n*S),nrow = S, ncol = n)
log_perms = get_log_perms(X, t, y, debug = FALSE, parallel = FALSE, num_cores = NULL)
num_nonzero_perms = sum(!is.na(log_perms))
num_nonzero_perms
log_ML = get_log_ML(log_perms, n, FALSE)
log_ML
Run the code above in your browser using DataLab