R/Acs.R

Defines functions Acs

#' @title Acs
#' @param z The input matrix.
#' @param n The number of nodes.
#' @return Z The latent class memberships.
#' @noRd
#' @keywords internal

Acs = function(z, n){
  #mu = z[, 1][1:n]
  mu = z[1:n]
  U = matrix(rep(mu, n), byrow = TRUE, nrow = n)
  V = matrix(rep(mu, n), byrow = FALSE, nrow = n)
  #Z = U + V + z[, 1][n + 1]*diag(n)
  Z = U + V + z[n + 1]*diag(n)
  return(Z)
}

Try the NAC package in your browser

Any scripts or data that you put into this service are public.

NAC documentation built on May 29, 2024, 4:45 a.m.