Skip to content

Commit

Permalink
fix permute clusters
Browse files Browse the repository at this point in the history
  • Loading branch information
helske committed Oct 12, 2024
1 parent b082e4f commit d5f1562
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions R/bootstrap.R
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ permute_clusters <- function(model, pcp_mle) {
m <- cost_matrix_clusters(pcp, pcp_mle)
perm <- RcppHungarian::HungarianSolver(m)$pairs[, 2]
model$gammas$omega[perm, , drop = FALSE]
model$gammas$pi <- lapply(model$gammas$pi, "[", perm)
model$gammas$A <- lapply(model$gammas$A, "[", perm)
model$gammas$B <- lapply(model$gammas$B, "[", perm)
model$gammas$pi <- model$gammas$pi[perm]
model$gammas$A <- model$gammas$A[perm]
model$gammas$B <- model$gammas$B[perm]
model
}
#' Bootstrap Sampling of NHMM Coefficients
Expand Down

0 comments on commit d5f1562

Please sign in to comment.