You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The SpecialFunctions package offers the incomplete beta function asbeta_inc. For reasons I don't really understand, this function returns a tuple of $I_x(a,b)$ and $1-I_x(a,b)$, so there are perhaps some design questions, but the derivative is computable in closed form, and there are already rules for SpecialFunctions.beta, so I don't think it would be too difficult. At the moment with DiffRules 1.0.2, ForwardDiff.derivative(a->SpecialFunctions.beta_inc(a, 1.0, 0.3), 1.0) causes a stack overflow, so it seems like defining a rule for this would have some value.
I'm happy to contribute a rule here, but I thought I'd just touch base about the best way to handle the tuple return type. Perhaps it would be best to just locally define a beta_inc1(a,b,x) = beta_inc(a,b,x)[1] and implement the derivative manually with DiffRules.@define_diffrule rather than trying to deal with the tuple return type. Interested to hear thoughts.
(edited because I mis-wrote something earlier about the derivatives being computed with the beta distribution pdf)
The text was updated successfully, but these errors were encountered:
Okay, sort of embarrassing, but I just did some back-of-the-envelope math incorrectly and thought that I could reduce things more than I could. You can write the derivatives in terms of hypergeometric functions, and those are implemented in Julia in a package, but that's obviously not a dependency to pull in here. I'll close this issue, and sorry for the noise.
The$I_x(a,b)$ and $1-I_x(a,b)$ , so there are perhaps some design questions, but the derivative is computable in closed form, and there are already rules for
SpecialFunctions
package offers the incomplete beta function asbeta_inc
. For reasons I don't really understand, this function returns a tuple ofSpecialFunctions.beta
, so I don't think it would be too difficult. At the moment with DiffRules 1.0.2,ForwardDiff.derivative(a->SpecialFunctions.beta_inc(a, 1.0, 0.3), 1.0)
causes a stack overflow, so it seems like defining a rule for this would have some value.I'm happy to contribute a rule here, but I thought I'd just touch base about the best way to handle the tuple return type. Perhaps it would be best to just locally define a
beta_inc1(a,b,x) = beta_inc(a,b,x)[1]
and implement the derivative manually withDiffRules.@define_diffrule
rather than trying to deal with the tuple return type. Interested to hear thoughts.(edited because I mis-wrote something earlier about the derivatives being computed with the beta distribution pdf)
The text was updated successfully, but these errors were encountered: