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 crash when specifying Poisson with decimal values #116

Open
alexrai93 opened this issue Jun 20, 2024 · 3 comments
Open

Session crash when specifying Poisson with decimal values #116

alexrai93 opened this issue Jun 20, 2024 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@alexrai93
Copy link

alexrai93 commented Jun 20, 2024

Hi, this code crashes my rstudio session when caching a model with poisson node containing decimal data.

I noticed that a few values I was working with had decimals and the issue was fixed when I rounded them to whole numbers.

Edit: I might suggest as it also causes issues with fitting a dag to throw an error if a Poisson node is numeric.

R 4.41 / Windows 11
Thanks!

====

options(scipen = 999)
library(tidyverse)
library(abn)

CarMod <- data.frame(
fueltype = factor(rep(c("gas", "diesel"), each = 2, length.out = 10)),
wheels = rep(c(1,2,3), each = 2, length.out = 10),
length = rep(c(1,2,3), each = 2, length.out = 10) * 100,
price = rep(c(1000.1, 10000, 13033, 10102, 10101),2))

dists <- list(
fueltype = "binomial",
wheels = "gaussian",
length = "gaussian",
price = "poisson"
)

cache <- buildScoreCache(CarMod, data.dists = dists, method = "mle")

@matteodelucchi matteodelucchi added the bug Something isn't working label Jun 24, 2024
@matteodelucchi
Copy link
Contributor

@j-i-l this might be related to #67

@j-i-l
Copy link
Collaborator

j-i-l commented Jun 28, 2024

Hi @alexrai93,

thanks for reporting this! I'll have a closer look at this in the next few days.

@j-i-l
Copy link
Collaborator

j-i-l commented Jul 31, 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
Projects
None yet
Development

No branches or pull requests

3 participants