Expected `test_regress_predcell(...)` not to throw any errors.
Actually got a <expectation_failure> with message:
  Expected `predcell_polcaparallel` to equal `predcell_polca`.
  Differences:
  actual vs expected
                          [,1]
    actual[2, ]    0.020945349
    actual[3, ]    0.016575043
    actual[4, ]    0.004272637
  - actual[5, ]    0.008564563
  + expected[5, ]          Inf
  - actual[6, ]    0.028096189
  + expected[6, ]          Inf
    actual[7, ]    0.005596553
    actual[8, ]    0.020945349
  - actual[9, ]    0.028096189
  + expected[9, ]          Inf
  - actual[10, ]   0.022356240
  + expected[10, ]         Inf
  - actual[11, ]   0.028096189
  + expected[11, ]         Inf
  and 43 more ...

#' Test the function poLCA.predcell() for the non-regression problem
#' Test the function poLCA.predcell() for the non-regression problem. The model
#' is fitted on data and then passed to the function with fully observed data.
#' The test compares the results with the original poLCA code
#' As with the original code, partially observed responses are not supported
#' @param n_outcomes Vector of integers, number of outcomes for each category
#' @param n_cluster Number of clusters fitted
#' @param n_rep Number of different initial values to try
#' @param na_rm Logical, if to remove NA responses
#' @param n_thread Number of threads to use
#' @param maxiter Number of iterations used in the EM algorithm
#' @param tol Tolerance used in the EM algorithm
#' @param prob_na_train Probability of missing data in the training data
#' @param n_data_test Number of data points in the unseen test data
#' @param prob_na_test Probability of missing data in the unseen test data
test_non_regress_predcell <- function(n_data, n_outcomes, n_cluster, n_rep,
lc <- poLCAParallel::poLCA(formula, responses, n_cluster,
maxiter = maxiter, tol = tol, na.rm = na_rm, nrep = n_rep,
responses <- random_response(n_data_test, n_outcomes, 0, NaN)
#' Test the function poLCA.posterior() for the regression problem
test_regress_predcell <- function(n_data, n_feature, n_outcomes, n_cluster,
responses <- random_response(n_data, n_outcomes, prob_na_train, NaN)
lc <- poLCAParallel::poLCA(formula, data, n_cluster,
# na_rm = FALSE not supported with missing data