greta-dev / greta

simple and scalable statistical modelling in R
https://greta-stats.org
Other
524 stars 63 forks source link

Add zero-inflated distributions (Poisson and Negative Binomial) #542

Closed olivuntu closed 2 years ago

olivuntu commented 2 years ago

In support of this thread in greta's forum : https://forum.greta-stats.org/t/problem-with-coding-a-new-probability-distribution-in-greta/231

njtierney commented 2 years ago

Thanks so much for this, @olivuntu !

Do you think you could submit this as a pull request in https://github.com/greta-dev/greta.distributions instead? We are putting extra distributions in there now.

This means you would do the following:

  1. Click the "fork" button in https://github.com/greta-dev/greta.distributions to create your copy, which will be at https://github.com/olivuntu/greta.distributions

  2. Clone that repository locally

  3. Copy over these files

    image

    (We don't need the travis file anymore, as we use a different approach to handle that 😃 )

  4. Run devtools::document()

  5. Submit a pull request to greta.distributions

njtierney commented 2 years ago

(I'm also happy to help move this over to greta.distributions myself if you would prefer :) )

olivuntu commented 2 years ago

Hi @njtierney, Great idea to have a side package for new distributions. I've just done that, but very quickly, only point 6) was problematic (could not function R6Class).

njtierney commented 2 years ago

Fantastic, thank you so much @olivuntu ! I'll review this today. I'll close this PR now as you've got that one open over there. :)