Skip to content

Commit

Permalink
test hurdle gamma trunc
Browse files Browse the repository at this point in the history
  • Loading branch information
wlangera committed Dec 2, 2024
1 parent f1cb7ed commit 4f6802c
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions source/markdown/test_densiteitsmodellering.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -1689,10 +1689,14 @@ stan_funs <- "
stanvars <- stanvar(scode = stan_funs, block = "functions")
conflicted::conflicts_prefer(brms::ar)
conflicted::conflicts_prefer(Distance::create.bins)
conflicted::conflicts_prefer(stats::lag)
test_hurdle_gamma_trunc <- brm(
formula = densiteit | trunc(lb = 1) ~ stratum + periode_in_jaar +
s(x_coord, y_coord) + (1 | plotnaam),
data = analysis_df_brms2[analysis_df_brms2$densiteit >= 1, ],
formula = densiteit ~ stratum + periode_in_jaar + s(x_coord, y_coord) +
(1 | plotnaam),
data = analysis_df_brms2,
family = hurdle_gamma_trunc,
stanvars = stanvars,
chains = nchains,
Expand All @@ -1701,6 +1705,13 @@ test_hurdle_gamma_trunc <- brm(
cores = nparallel,
thin = thinning,
seed = 123)
posterior_predict_hurdle_gamma_trunc <- function(i, prep, ...) {

Check warning on line 1709 in source/markdown/test_densiteitsmodellering.Rmd

View workflow job for this annotation

GitHub Actions / check project with checklist

file=source/markdown/test_densiteitsmodellering.Rmd,line=1709,col=1,[object_length_linter] Variable and function names should not be longer than 30 characters.
mu <- brms::get_dpar(prep, "mu", i = i)
phi <- brms::get_dpar(prep, "phi", i = i)
trials <- prep$data$vint1[i]
hurdle_gamma_trunc_rng(mu, phi, trials)

Check warning on line 1713 in source/markdown/test_densiteitsmodellering.Rmd

View workflow job for this annotation

GitHub Actions / check project with checklist

file=source/markdown/test_densiteitsmodellering.Rmd,line=1713,col=3,[object_usage_linter] no visible global function definition for 'hurdle_gamma_trunc_rng'
}
```

```{r}
Expand Down

0 comments on commit 4f6802c

Please sign in to comment.