analysis/random_perm_search.R

random_perm_search <- function(A){
  # Copyright (c) 2018-2018  Jonas Peters [[email protected]]
  # All rights reserved.  See the file COPYING for license terms.
  
  p <- NROW(A) # number of variables
  order <-  sample(p, p, replace = FALSE)
  A <- A[order, order]
  score <- sum(A[upper.tri(A)])
  
  return(list(score = score, order = order))
}
nicolagnecco/causalXtreme documentation built on Jan. 29, 2020, 5:50 p.m.