Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GP hyperparams cannot converge when specifying GP over growth rate derivative #31

Open
AugustHao opened this issue Jul 5, 2024 · 4 comments

Comments

@AugustHao
Copy link
Contributor

when growth_rate_deriv effect is selected in https://github.com/idem-lab/epiwave/blob/main/R/create_infection_timeseries.R

model loses traction over GP hyperparameters, leading to model failing to initiate or non-convergence. I suspect this is because only a narrow region of hyperparameter values can produce a GP that fits with growth rate derivative, depending on features of the data. May need to consider changing kernel choice

@AugustHao
Copy link
Contributor Author

AugustHao commented Jul 5, 2024

working with simulated infections and the follow code to back calculate a GP that would fit to the data, seems like a very short lengthscale is required

log_N_t <- log(N_t)

log_N_t_init <- log(100)

round(exp(log_N_t-log_N_t_init)*100) == round(N_t)

x <- log_N_t-log_N_t_init

discum_x <- eufmdis.adapt:::discumulate_data(x)
discum_discum_x <- eufmdis.adapt:::discumulate_data(discum_x)


k_l <- lognormal(3,1)
k_var <- normal(0, 1, truncation = c(0, Inf))
gp_k <- mat52(k_l, k_var)

gp <- gp(
  x = 1:(n_times),
  kernel = gp_k,
  n = 1,
  #inducing = days_sparse,
  tol = .Machine$double.eps
)

distribution(discum_discum_x) <- normal(gp,sd = 0.003)

m <- model(gp)

fit <- mcmc(m,warmup = 100,n_samples = 100)

calculate(k_l,values = fit,nsim = 1e3)[[1]] %>% summary()
calculate(k_var,values = fit,nsim = 1e3)[[1]] %>% summary()

@AugustHao
Copy link
Contributor Author

AugustHao commented Jul 8, 2024

update, deriv works with ACEFA covid data, if backing out DoW model, but still does not work on simulated SIRS data

edit: nvm still unidentifiable but can initiate

@AugustHao
Copy link
Contributor Author

update: init helper overcomes the issue, but working on implementing with epiwave as need to give init to one of class attribute of gp and that doesn't seem to get passed successfully

@AugustHao
Copy link
Contributor Author

init helper doesn't get around another obs type (eg sero, need to debug init stability further)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant