canmod / macpan2

Rebuilding https://github.com/mac-theobio/McMasterPandemic/
https://canmod.github.io/macpan2/
GNU General Public License v3.0
2 stars 0 forks source link

Report dimensions of matrices involved in bad recycling errors #187

Closed stevencarlislewalker closed 6 months ago

stevencarlislewalker commented 6 months ago

Very much a wish list, but if this error:

Error in self$.runner(..., .phases = .phases, .method = "report") : The following error was thrown by the TMB engine: cannot recycle rows and/or columns because the input is inconsistent with the recycling request This error occurred at the following expression: log_lik ~ -sum(dnorm(I_obs, wk_incidence, I_sd))

also reported the incommensurate dimensions (in this case I_obs was of length 29 and wk_incidence was of length 5 ...) that would help with diagnosis ...

Originally posted by @bbolker in https://github.com/canmod/macpan2/issues/186#issuecomment-1992530694

stevencarlislewalker commented 6 months ago

Current behaviour (FYI -- @bbolker):

> engine_eval(~dnorm(1, 1:2, 1:3))
Error in self$.runner(..., .phases = .phases, .method = "report") : 
The following error was thrown by the TMB engine:
  cannot recycle rows and/or columns because the input is inconsistent with the recycling request
This error occurred at the following expression:
  output ~ dnorm(1, 1:2, 1:3)
This error occurred in the following function:
  dnorm
This function call got 3 arguments, each of which is described by the rows of the following table:

Rows  Cols  Types 
----  ----  ----- 
1     1     double
2     1     double
3     1     double