Running 'coef.R' [7s]
  Running 'confint.R' [65s]
  Running 'datetime.R' [2s]
  Running 'egf.R' [7s]
  Running 'egf_enum.R' [2s]
  Running 'egf_eval.R' [2s]
  Running 'egf_examples_day_of_week.R' [3s]
  Running 'egf_examples_excess.R' [2s]
  Running 'egf_examples_fixed.R' [3s]
  Running 'egf_examples_random.R' [49s]
  Running 'egf_link.R' [2s]
  Running 'egf_misc.R' [8s]
  Running 'egf_options.R' [2s]
  Running 'egf_utils.R' [8s]
  Running 'epidemic.R' [2s]
  Running 'extract.R' [7s]
  Running 'fitted.R' [6s]
  Running 'gi.R' [2s]
  Running 'include.R' [127s]
  Running 'language.R' [2s]
  Running 'prior.R' [2s]
  Running 'profile.R' [44s]
  Running 'summary.R' [7s]
  Running 'utils.R' [2s]
  Running 'validity.R' [2s]
  Running 'zzz.R' [2s]
Running the tests in 'tests/egf_examples_random.R' failed.
Complete output:
  > library(epigrowthfit)
  > options(warn = 2L, error = if (interactive()) recover, egf.cores = 2L)
  > 
  > 
  > ## exponential #########################################################
  > 
  > r <- log(2) / 20
  > c0 <- 100
  > s <- 0.2
  > 
  > mu <- log(c(r, c0))
  > Sigma <- diag(rep.int(s^2, length(mu)))
  > 
  > zz <- simulate(egf_model(curve = "exponential", family = "pois"),
  +                nsim = 20L,
  +                seed = 775494L,
  +                mu = mu,
  +                Sigma = Sigma,
  +                cstart = 10)
  > mm <- egf(zz,
  +           formula_priors = list(Sigma ~ LKJ(eta = 2)))
  > 
  > p1 <- as.list(coef(zz))
  > p2 <- as.list(coef(mm))
  > 
  > stopifnot(exprs = {
  + 	max(abs(mm[["gradient"]])) < 5e-05
  + 	all.equal(p1[["beta"]], p2[["beta"]], tolerance = 5e-02)
  + 	all.equal(theta2cov(p1[["theta"]]), theta2cov(p2[["theta"]]), tolerance = 5e-02)
  + })
  > 
  > 
  > ## subexponential ######################################################
  > 
  > alpha <- log(2) / 20
  > c0 <- 100
  > p <- 0.95
  > s <- 0.2
  > 
  > mu <- c(log(alpha), log(c0), qlogis(p))
  > Sigma <- diag(rep.int(s^2, length(mu)))
  > 
  > zz <- simulate(egf_model(curve = "subexponential", family = "pois"),
  +                nsim = 20L,
  +                seed = 653927L,
  +                mu = mu,
  +                Sigma = Sigma,
  +                cstart = 10)
  > mm <- egf(zz,
  +           formula_priors = list(beta[3L] ~ Normal(mu = qlogis(p), sigma = 0.05),
  +                                 theta[3L] ~ Normal(mu = log(s), sigma = 0.25),
  +                                 Sigma ~ LKJ(eta = 2)))
  > 
  > p1 <- as.list(coef(zz))
  > p2 <- as.list(coef(mm))
  > 
  > stopifnot(exprs = {
  + 	max(abs(mm[["gradient"]])) < 5e-04
  + 	all.equal(p1[["beta"]], p2[["beta"]], tolerance = 5e-02)
  + 	all.equal(theta2cov(p1[["theta"]]), theta2cov(p2[["theta"]]), tolerance = 2e-02)
  + })
  > 
  > 
  > ## gompertz ############################################################
  > 
  > alpha <- log(2) / 20
  > tinfl <- 100
  > K <- 25000
  > s <- 0.2
  > 
  > mu <- log(c(alpha, tinfl, K))
  > Sigma <- diag(rep.int(s^2, length(mu)))
  > 
  > zz <- simulate(egf_model(curve = "gompertz", family = "pois"),
  +                nsim = 20L,
  +                seed = 685399L,
  +                mu = mu,
  +                Sigma = Sigma,
  +                cstart = 10)
  > oo <- options(warn = 1L) # FIXME: diagnose NA/NaN function evaluation
  > mm <- egf(zz,
  +           formula_priors = list(Sigma ~ LKJ(eta = 2)))
  > options(oo)
  > 
  > p1 <- as.list(coef(zz))
  > p2 <- as.list(coef(mm))
  > 
  > stopifnot(exprs = {
  + 	max(abs(mm[["gradient"]])) < 5e-04
  + 	all.equal(p1[["beta"]], p2[["beta"]], tolerance = 5e-02)
  + 	all.equal(theta2cov(p1[["theta"]]), theta2cov(p2[["theta"]]), tolerance = 2e-02)
  + })
  > 
  > 
  > ## logistic ############################################################
  > 
  > r <- log(2) / 20
  > tinfl <- 100
  > K <- 25000
  > s <- 0.2
  > 
  > mu <- log(c(r, tinfl, K))
  > Sigma <- diag(rep.int(s^2, length(mu)))
  > 
  > zz <- simulate(egf_model(curve = "logistic", family = "pois"),
  +                nsim = 20L,
  +                seed = 397981L,
  +                mu = mu,
  +                Sigma = Sigma,
  +                cstart = 10)
  > mm <- egf(zz,
  +           formula_priors = list(Sigma ~ LKJ(eta = 2)))
  > 
  > p1 <- as.list(coef(zz))
  > p2 <- as.list(coef(mm))
  > 
  > stopifnot(exprs = {
  + 	max(abs(mm[["gradient"]])) < 1e-02
  + 	all.equal(p1[["beta"]], p2[["beta"]], tolerance = 1e-02)
  + 	all.equal(theta2cov(p1[["theta"]]), theta2cov(p2[["theta"]]), tolerance = 2e-02)
  + })
  > 
  > 
  > ## richards ############################################################
  > 
  > r <- log(2) / 20
  > tinfl <- 100
  > K <- 25000
  > a <- 1.005
  > s <- 0.2
  > 
  > mu <- log(c(r, tinfl, K, a))
  > Sigma <- diag(rep.int(s^2, length(mu)))
  > 
  > zz <- simulate(egf_model(curve = "richards", family = "pois"),
  +                nsim = 20L,
  +                seed = 949642L,
  +                mu = mu,
  +                Sigma = Sigma,
  +                cstart = 10)
  > mm <- egf(zz,
  +           formula_priors = list(beta[4L] ~ Normal(mu = log(a), sigma = 0.005),
  +                                 theta[4L] ~ Normal(mu = log(s), sigma = 0.25),
  +                                 Sigma ~ LKJ(eta = 2)))