Skip to content

Commit

Permalink
fix issue #1633
Browse files Browse the repository at this point in the history
  • Loading branch information
paul-buerkner committed Aug 13, 2024
1 parent 2917e72 commit d295d4e
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 43 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,4 @@ Additional_repositories:
VignetteBuilder:
knitr,
R.rsp
RoxygenNote: 7.3.1
RoxygenNote: 7.3.2
7 changes: 4 additions & 3 deletions R/stan-likelihood.R
Original file line number Diff line number Diff line change
Expand Up @@ -714,6 +714,8 @@ stan_log_lik_wiener <- function(bterms, resp = "", mix = "", threads = NULL,
}

stan_log_lik_beta <- function(bterms, resp = "", mix = "", ...) {
# TODO: check if we still require n when phi is predicted
# and check the same for other families too
reqn <- stan_log_lik_adj(bterms) || nzchar(mix) ||
paste0("phi", mix) %in% names(bterms$dpars)
p <- stan_log_lik_dpars(bterms, reqn, resp, mix)
Expand All @@ -724,10 +726,9 @@ stan_log_lik_beta <- function(bterms, resp = "", mix = "", ...) {
}

stan_log_lik_von_mises <- function(bterms, resp = "", mix = "", ...) {
reqn <- stan_log_lik_adj(bterms) || nzchar(mix) ||
"kappa" %in% names(bterms$dpars)
reqn <- stan_log_lik_adj(bterms) || nzchar(mix)
p <- stan_log_lik_dpars(bterms, reqn, resp, mix)
sdist("von_mises2", p$mu, p$kappa)
sdist("von_mises", p$mu, p$kappa)
}

stan_log_lik_cox <- function(bterms, resp = "", mix = "", threads = NULL,
Expand Down
34 changes: 0 additions & 34 deletions inst/chunks/fun_von_mises.stan

This file was deleted.

5 changes: 0 additions & 5 deletions tests/testthat/tests.stancode.R
Original file line number Diff line number Diff line change
Expand Up @@ -484,11 +484,6 @@ test_that("self-defined functions appear in the Stan code", {
expect_match2(scode, "real inv_gaussian_lccdf(real y")
expect_match2(scode, "real inv_gaussian_lpdf(vector y")

# von Mises models
scode <- stancode(time ~ age, data = kidney, family = von_mises)
expect_match2(scode, "real von_mises2_lpdf(real y")
expect_match2(scode, "real von_mises2_lpdf(vector y")

# zero-inflated and hurdle models
expect_match2(stancode(count ~ Trt, data = epilepsy,
family = "zero_inflated_poisson"),
Expand Down

0 comments on commit d295d4e

Please sign in to comment.