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

Session crashes / low-level error from irls_poisson_fast.cpp if no solution found by solve() #67

Open
matteodelucchi opened this issue Dec 19, 2023 · 1 comment
Assignees
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@matteodelucchi
Copy link
Contributor

No description provided.

@matteodelucchi
Copy link
Contributor Author

Given two poisson variables:

  mydists <- list(a="poisson",
                  b="poisson")
  a <- rpois(1000, lambda = 1)
  z <- exp(1+2*a)
  b <- rpois(1000, lambda = z)
  mydf <- data.frame("a" = a,
                     "b" = as.integer(b))

We can estimate the following model:

  glm(b~a, data = mydf, family = "poison")

Problem 1

A similar behaviour as from glm() should be expected from buildScoreCache

>   mycache.mle <- buildScoreCache(data.df = mydf,
+                                  data.dists = mydists,
+                                  method = "mle",
+                                  max.parents = 1,
+                                  verbose = TRUE)
evaluation # 1:
$row.num
[1] 1

result of evaluating expression:
[1] -1302.247  2606.494  2611.402  2612.095
got results for task 1
numValues: 1, numResults: 1, stopped: FALSE
returning status FALSE
evaluation # 2:
$row.num
[1] 2

result of evaluating expression:
[1] -1263.188  2530.377  2540.193  2541.579
got results for task 2
numValues: 2, numResults: 2, stopped: FALSE
returning status FALSE
evaluation # 3:
$row.num
[1] 3

result of evaluating expression:
[1] -Inf  Inf  Inf  Inf
got results for task 3
numValues: 3, numResults: 3, stopped: FALSE
returning status FALSE
evaluation # 4:
$row.num
[1] 4

result of evaluating expression:
<std::runtime_error: solve(): solution not found>
got results for task 4
accumulate got an error result
numValues: 4, numResults: 4, stopped: FALSE
returning status FALSE
numValues: 4, numResults: 4, stopped: TRUE
first call to combine function
evaluating call object to combine results:
  fun(result.1, result.2, result.3)
Error in { : task 4 failed - "solve(): solution not found"
In addition: Warning messages:
1: In check.valid.groups(group.var = group.var, data.df = data.df,  :
  No cor.vars specified. Using all but group.var instead.
2: In check.valid.groups(group.var = group.var, data.df = data.df,  :
  No cor.vars specified. Using all but group.var instead.
3: In check.valid.buildControls(control = control, method = method,  :
  Control parameters provided that are not used with method mle are ignored.

The error seems to come from irls_poisson_fast.cpp() which can not find solutions for all possible combinations.

  • Why does glm() work but buildScoreCache doesn't?
  • 1st priority: Have similar behaviour as glm.
  • 2nd priority: Can we at least return a more informative error message?

Problem 2

If a is wrongly provided as

a <- runif(1000, min=1, max=2.5)

but is still specified in data.dists=list(a="poisson"...); this is not catched anywhere and results in a silent (nothing written to syslog, dmesg, debug, ... and also no special behaviour detected in htop) crash of the R session.

  • Why does R crash silently?
  • Let R not crash!!!

@matteodelucchi matteodelucchi added the bug Something isn't working label Dec 19, 2023
@matteodelucchi matteodelucchi transferred this issue from another repository Apr 9, 2024
@matteodelucchi matteodelucchi added the good first issue Good for newcomers label Apr 9, 2024
@matteodelucchi matteodelucchi transferred this issue from furrer-lab/shuttle-abn Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant