tensor_predictors/tensorPredictors/R/ising_m2.R

19 lines
451 B
R
Raw Normal View History

2023-11-14 13:35:43 +00:00
#' @export
ising_m2 <- function(
params, use_MC = NULL, nr_samples = 10000L,
warmup = 15L, nr_threads = 1L
) {
if (missing(use_MC)) {
use_MC <- if (is.matrix(params)) 19 < nrow(params) else 190 < length(params)
}
m2 <- .Call("C_ising_m2", params, use_MC, nr_samples, warmup, nr_threads,
PACKAGE = "tensorPredictors"
)
M2 <- vech.pinv(m2)
attr(M2, "log_prob_0") <- attr(m2, "log_prob_0")
2023-11-14 13:35:43 +00:00
M2
}