Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
helske committed Nov 8, 2024
1 parent 99d6883 commit 36206c1
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 9 deletions.
2 changes: 1 addition & 1 deletion R/fit_nhmm.R
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ fit_nhmm <- function(model, inits, init_sd, restarts, lambda, method,

logliks <- unlist(lapply(out, "[[", "penalized_logLik")) * n_obs
optimum <- out[[which.max(logliks)]]
init <- setNames(
init <- stats::setNames(
optimum[c("eta_pi", "eta_A", "eta_B")], c("pi", "A", "B")
)
if (save_all_solutions) {
Expand Down
10 changes: 10 additions & 0 deletions man/estimate_mnhmm.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions man/estimate_nhmm.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions tests/testthat/test-build_hmm.R
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,11 @@ test_that("build_hmm returns the correct probabilities", {

expect_equal(
rowSums(model$transition_probs),
setNames(rep(1, s), paste("State", 1:s))
stats::setNames(rep(1, s), paste("State", 1:s))
)
expect_equal(
rowSums(model$emission_probs),
setNames(rep(1, s), paste("State", 1:s))
stats::setNames(rep(1, s), paste("State", 1:s))
)
expect_equal(colnames(model$emission_probs), letters[1:s])
expect_true(all(model$transition_probs >= 0))
Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/test-build_mm.R
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,11 @@ test_that("build_mm returns the correct probabilities", {
)
expect_equal(
rowSums(model$transition_probs),
setNames(rep(1, s), letters[1:s])
stats::setNames(rep(1, s), letters[1:s])
)
expect_equal(
rowSums(model$emission_probs),
setNames(rep(1, s), letters[1:s])
stats::setNames(rep(1, s), letters[1:s])
)
expect_true(all(model$transition_probs >= 0))
expect_true(all(model$emission_probs >= 0))
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-build_mmm.R
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,6 @@ test_that("build_mmm returns the correct number of states", {
)
expect_equal(
lengths(model$initial_probs),
setNames(rep(s, k), paste("Cluster", 1:k))
stats::setNames(rep(s, k), paste("Cluster", 1:k))
)
})

0 comments on commit 36206c1

Please sign in to comment.