The regularized incomplete beta function I(x,a,b) is the CDF for a random variable distributed Beta(a,b). I have a problem that requires computing the partial derivatives of its inverse (the quantile function) w.r.t. parameters a and b. Do you know of any R functions that do this? Thank you!
CodePudding user response:
I don't know if there's a closed-form analytical expression, but you can do it numerically (numDeriv::grad()
uses Richardson extrapolation by default, see the documentation):
x <- 0.5
## dummy (lambda) function with x from above and specified shape parameters
f <- function(y) qbeta(x, y[1], y[2])
library(numDeriv)
grad(f,
## shape parameters at which to evaluate partial derivatives
x = c(1,1)
)
## [1] 0.3465736 -0.3465736
?