Skip to content

Commit

Permalink
fix bounds of initial conditions for delays
Browse files Browse the repository at this point in the history
  • Loading branch information
sbfnk committed Oct 10, 2023
1 parent 3a05c06 commit c1d9772
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion R/create.R
Original file line number Diff line number Diff line change
Expand Up @@ -513,8 +513,12 @@ create_initial_conditions <- function(data) {
init_fun <- function() {
out <- list()
if (data$delay_n_p > 0) {
out$delay_mean <- array(rep(0, data$delay_n_p))
lower_bounds <- rep(-Inf, data$delay_n_p)
## gamma
lower_bounds[data$dist == 1] <- 0
out$delay_mean <- array(truncnorm::rtruncnorm(
n = data$delay_n_p, a = 0,
n = data$delay_n_p, a = lower_bounds,
mean = data$delay_mean_mean, sd = data$delay_mean_sd * 0.1
))
out$delay_sd <- array(truncnorm::rtruncnorm(
Expand Down

0 comments on commit c1d9772

Please sign in to comment.