mrc-ide / drjacoby

Flexible Markov chain monte carlo via reparameterization
https://mrc-ide.github.io/drjacoby/
Other
12 stars 6 forks source link

Error thrown with no intitial conditions and Inf #12

Closed pwinskill closed 4 years ago

pwinskill commented 4 years ago

With infinitie bound specified for parameter, and no initial conditions specified error thrown during fitting.

E.G. running the intro vignette without initial conditions:

df_params <- data.frame(name = c("mu", "sigma"),
                        min = c(-10, 0),
                        max = c(10, Inf))

throws the error: Error in lm.fit(x, y, offset = offset, singular.ok = singular.ok, ...) : 0 (non-NA) cases

with traceback:

7: stop("0 (non-NA) cases")
6: lm.fit(x, y, offset = offset, singular.ok = singular.ok, ...)
5: lm(x[, i] ~ z)
4: spectrum0.ar(x)
3: FUN(newX[, i], ...)
2: apply(all_chains, 2, coda::effectiveSize)
1: run_mcmc(data = x, df_params = df_params, loglike = r_loglike, 
       logprior = r_logprior, chains = 1, burnin = 1000, samples = 1000)