
The “beta integral” which is just a multiple of the non regularized incomplete beta function. This function merely provides an R interface to the C level routine. It is not exported by the package.
betaint(x, a, b)
vector of quantiles.
parameters. See Details for admissible values.
The value of the integral.
Invalid arguments will result in return value NaN
, with a warning.
Function betaint
computes the “beta integral”
gamma()
and defined in its help.)
When pbeta(x, a, b)
. When
This function is used (at the C level) to compute the
limited expected value for distributions of the transformed beta
family; see, for example, levtrbeta
.
Abramowitz, M. and Stegun, I. A. (1972), Handbook of Mathematical Functions, Dover.
Klugman, S. A., Panjer, H. H. and Willmot, G. E. (2012), Loss Models, From Data to Decisions, Fourth Edition, Wiley.
# NOT RUN {
x <- 0.3
a <- 7
## case with b > 0
b <- 2
actuar:::betaint(x, a, b)
gamma(a) * gamma(b) * pbeta(x, a, b) # same
## case with b < 0
b <- -2.2
r <- floor(-b) # r = 2
actuar:::betaint(x, a, b)
## "manual" calculation
s <- (x^(a-1) * (1-x)^b)/b +
((a-1) * x^(a-2) * (1-x)^(b+1))/(b * (b+1)) +
((a-1) * (a-2) * x^(a-3) * (1-x)^(b+2))/(b * (b+1) * (b+2))
-gamma(a+b) * s +
(a-1)*(a-2)*(a-3) * gamma(a-r-1)/(b*(b+1)*(b+2)) *
gamma(b+r+1)*pbeta(x, a-r-1, b+r+1)
# }
Run the code above in your browser using DataLab