Hacktoberfest 2026 : les issues que les mainteneurs ont marquées pour octobre, ouvertes et accessibles aux débutants. Parcourir les issues Hacktoberfest

Implement gammalogccdf for ForwardDiff

Ouverte
#666 1 commentaire 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

Personne n'a encore pris cette issue.

Évaluation

Difficulté
4/5
Temps estimé
3-5 jours
Accessibilité débutants
35/100
Type d'issue
Bug
Clarté
Plutôt claire
Activité
À l'abandon
Stack technique
julia
Domaine
devtools

Piste de recherche

Commencez par reproduire le MethodError affiché et inspectez le point d’entrée gammalogccdf dans StatsFuns/src/distrs/gamma.jl, ainsi que les arguments ForwardDiff.Dual dans la stack trace. Suivez le chemin de Poisson tronqué jusqu’à cet appel ; le travail est terminé lorsque ce chemin ne déclenche plus le MethodError signalé pour les entrées ForwardDiff.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

I am modeling in Turing.jl some process in which I use Gamma prior to parametrize Truncated Poisson and I use NUTs sampler.

However, my model has nested dependence and I cannot fully vectorize the loop, so Zygote would be slow. The default ForwardDiff throws at me an error

ERROR: MethodError: no method matching _gammalogccdf(::ForwardDiff.Dual{ForwardDiff.Tag{Turing.TuringTag, Float64}, Float64, 8}, ::ForwardDiff.Dual{ForwardDiff.Tag{Turing.TuringTag, Float64}, Float64, 8}, ::ForwardDiff.Dual{ForwardDiff.Tag{Turing.TuringTag, Float64}, Float64, 8})
Stacktrace:
  [1] gammalogccdf(k::Int64, θ::Int64, x::ForwardDiff.Dual{ForwardDiff.Tag{Turing.TuringTag, Float64}, Float64, 8})
    @ StatsFuns ~/.julia/packages/StatsFuns/atA5S/src/distrs/gamma.jl:71
  [2] poislogcdf(λ::ForwardDiff.Dual{ForwardDiff.Tag{Turing.TuringTag, Float64}, Float64, 8}, x::Int64)
    @ StatsFuns ~/.julia/packages/StatsFuns/atA5S/src/distrs/pois.jl:30
  [3] logcdf(d::Poisson{ForwardDiff.Dual{ForwardDiff.Tag{Turing.TuringTag, Float64}, Float64, 8}}, x::Int64)
    @ Distributions ~/.julia/packages/Distributions/Ufrz2/src/univariates.jl:638
  [4] _logcdf_noninclusive(d::Poisson{ForwardDiff.Dual{ForwardDiff.Tag{Turing.TuringTag, Float64}, Float64, 8}}, x::Int64)
    @ Distributions ~/.julia/packages/Distributions/Ufrz2/src/censored.jl:441
  [5] truncated(d::Poisson{ForwardDiff.Dual{ForwardDiff.Tag{Turing.TuringTag, Float64}, Float64, 8}}, l::Int64, u::Int64)
    @ Distributions ~/.julia/packages/Distributions/Ufrz2/src/truncate.jl:67
  [6] Truncated(d::Poisson{ForwardDiff.Dual{ForwardDiff.Tag{Turing.TuringTag, Float64}, Float64, 8}}, l::Int64, u::Int64)
    @ Distributions ./deprecated.jl:105
  [7] macro expansion

To my understanding this error suggests that the model is encountering issues with automatic differentiation, specifically when evaluating the complementary cumulative distribution function (CCDF) of the Gamma distribution. Seems like the error might be related to the Truncated Poisson distribution, as the truncation operation might involve the CCDF of the underlying distribution.

Can that be solved in ForwardDiff AD ?

Langage dominant
Julia
Étoiles
1k
Forks
165
Merge moyen
6 h 34 min
PR mergées (30 j)
1

Préparer son environnement

Ce projet ne fournit ni conteneur de développement, ni Dockerfile, ni guide de contribution : l'installation est à votre charge. Commencez par son README, et consultez notre guide de la première contribution pour les étapes générales.

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de JuliaDiff/ForwardDiff.jl

Toutes les issues de JuliaDiff/ForwardDiff.jl

Issues similaires

Plus d'issues Julia

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.