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

Implement Hessian testing #33

Open
rafalopespx opened this issue Aug 22, 2022 · 1 comment
Open

Implement Hessian testing #33

rafalopespx opened this issue Aug 22, 2022 · 1 comment
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@rafalopespx
Copy link
Collaborator

Hessian test is constructed to avoid problems when the INLA solver stack in negative eigenvalues, to avoid it we can work on the length iteration steps. The test can be implemented through a while test until it reach a certain amount of tries. Follows a schematic test to be put on the nowcasting_age and nowcasting_no_age functions:

hess.min <- -1
h.value <- 0.01
h.trials <- 0.001
trials <- 0
while (hess.min <= 0 & trials < 50){
    
    # Running the Negative Binomial model in INLA
    output0 <- inla(model, family = "nbinomial", data = dados.age,
                    control.predictor = list(link = 1, compute = T),
                    control.compute = list(config = T, waic=F, dic=F, openmp.strategy='huge'),
                    control.family = list(
                      hyper = list("theta" = list(prior = "loggamma", 
                                                  param = c(0.001, 0.001))
                      )
                    ),
                    num.threads = 6,
                    control.inla = list(h = h.value),
                    ...
                    
    )
    hess.start <- which(output0$logfile == 'Eigenvalues of the Hessian')
    hess.min <- min(as.numeric(output0$logfile[(hess.start+1):(hess.start+3)]))
    h.value <- h.trials + 0.001
    h.trials <- h.value
    trials <- trials + 1
    
  }
@rafalopespx rafalopespx added enhancement New feature or request help wanted Extra attention is needed labels Aug 22, 2022
@rafalopespx rafalopespx self-assigned this Aug 22, 2022
@rafalopespx
Copy link
Collaborator Author

Input the hessian test as a parameter on the nowcasting_inla that parse to nowcasting_age and nowcasting_no_age

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Development

No branches or pull requests

1 participant