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

Model builder tutorial #339

Closed
PieterjanRobbe opened this issue Nov 16, 2024 · 4 comments · Fixed by #341
Closed

Model builder tutorial #339

PieterjanRobbe opened this issue Nov 16, 2024 · 4 comments · Fixed by #341
Assignees
Labels
bug Something isn't working JOSS Joss paper issues

Comments

@PieterjanRobbe
Copy link

Hi there,

I'm working my way through the Model builder tutorial. After launching the Shiny app in this section, I follow the instructions in the tutorial. I go to the Features tab and toggle the cases checkmark. Then, under the Model tab, I click Run, and I get this error:

 *** inla.core.safe:  The inla program failed, but will rerun in case better initial values may help. try=1/1 
Loading required package: INLA
Loading required package: Matrix
This is INLA_24.11.07-4 built 2024-11-07 10:56:07 UTC.
 - See www.r-inla.org/contact-us for how to get help.
 - List available models/likelihoods/etc with inla.list.models()
 - Use inla.doc(<NAME>) to access documentation
Warning in iinla(model = info[["model"]], lhoods = info[["lhoods"]], options = info[["options"]]) :
  iinla: Problem in inla: Error in inla.core.safe(formula = formula, family = family, contrasts = contrasts,  : 
  The response for family[1] is not of type 'numeric|list|matrix'; don't know what to do.
The inla program failed and the maximum number of tries has been reached.
iinla: Problem in inla: 1: workRSOCK()
2: workLoop(makeSOCKmaster(master, port, setup_timeout, timeout, 
       useXDR, setup_strategy))
3: workCommand(master)
4: tryCatch({
       msg <- recvData(master)
       if (msg$type == "DONE") {
           closeNode(master)
           FALSE
       }
       else if (msg$type == "EXEC") {
           success <- TRUE
           handler <- function(e) {
               success <<- FALSE
               structure(conditionMessage(e), class = c("snow-try-error", 
                   "try-error"))
           }
           t1 <- proc.time()
           value <- tryCatch(do.call(msg$data$fun, msg$data$args, 
               quote = TRUE), error = handler)
           t2 <- proc.time()
      [... truncated]
iinla: Giving up and returning last successfully obtained result for diagnostic purposes.
Warning: Error in create_prediction_field: var_b must be provided for predicted_mean_fields plot
  82: stop
  81: create_prediction_field
  80: <reactive>
  64: prediction_field
  63: <reactive>
  47: z_values
  46: ::
shiny
observe
  45: <observer>
   2: shiny::runApp
   1: fdmr::model_builder

Am I missing something?

breadcrumb

@mnky9800n mnky9800n added bug Something isn't working JOSS Joss paper issues labels Nov 19, 2024
@mnky9800n
Copy link
Contributor

Did you change any of the codes? I am unable to recreate this issue.

@PieterjanRobbe
Copy link
Author

Hi @mnky9800n. No, I literally copy-pasted from the tutorial. Here's the model specification:

Screenshot 2024-11-19 at 9 47 52 AM

@aabelean aabelean mentioned this issue Dec 18, 2024
3 tasks
@aabelean aabelean linked a pull request Dec 18, 2024 that will close this issue
3 tasks
@aabelean
Copy link
Contributor

Hi @PieterjanRobbe,

I think the issue is that the variable "UtlaName" (and also MSOA11CD) is a string variable. INLA (and inlabru) does not accept them for this purpose. I suggest we no longer offer non-numeric/non-logical variables to be selected as model/exposure variables or features.

@mnky9800n
Copy link
Contributor

This is true and should be taken care of by adding a bit of logic to the app

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working JOSS Joss paper issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants