Skip to content

Commit

Permalink
fix number of samples
Browse files Browse the repository at this point in the history
  • Loading branch information
helske committed Dec 2, 2024
1 parent 8e5b1ef commit 992208c
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 @@ -156,7 +156,7 @@ bootstrap_coefs.nhmm <- function(model, nsim = 1000,
warning_(
paste0(
"Estimation in some of the bootstrap samples failed.",
"Returning samples from {length(boot)} successes out of {nsim} ",
"Returning samples from {length(boot[[1]]} successes out of {nsim} ",
"bootstrap samples."
)
)
Expand Down Expand Up @@ -256,11 +256,11 @@ bootstrap_coefs.mnhmm <- function(model, nsim = 1000,
gamma_omega = lapply(out, "[[", "omega")
)
boot <- lapply(boot, function(x) x[lengths(x) > 0])
if (length(boot) < nsim) {
if (length(boot[[1]]) < nsim) {
warning_(
paste0(
"Estimation in some of the bootstrap samples failed.",
"Returning samples from {length(boot)} successes out of {nsim} ",
"Returning samples from {length(boot[[1]]} successes out of {nsim} ",
"bootstrap samples."
)
)
Expand Down

0 comments on commit 992208c

Please sign in to comment.