Unlimited learning, half price | 50% off

Last chance! 50% off unlimited learning

Sale ends in


curesurv (version 0.1.1)

inc.beta.deriv: inc_beta_deriv function

Description

computes the first and second derivatives of incomplete Beta function with respect of Beta parameters p and or q using algorithm differentiating the aproximants of Ix,p,q formula in terms of forward recurrence relations where the the nth approximant can be expressed as : Ix,p,qKx,p,qAn/Bn, n1

This technique was proposed by Moore (1982) to calculate the derivatives of incomplete gamma function.

Usage

inc.beta.deriv(
  x,
  p = stop("p must be specified"),
  q = stop("q must be specified"),
  err = .Machine$double.eps * 10000,
  minapp = 2,
  maxapp = 1000
)

Value

An object of class FD.inc.beta. This object is a list containing 15 components. The first 13 components in the list are each a vector of the same length as x (u in the model). The two last elements are scalar terms. The output elements are:

I

Ix,p,q. This equal to the output of pbeta(x,shape1,shape2)

Ip

Ix,p,qp denotes the first derivative of the incomplete beta function with respect to p

Ipp

Ix,p,qpp denotes the second derivative of the incomplete beta function with respect to p

Iq

Ix,p,qq denotes the first derivative of the incomplete beta function with respect to q

Iqq

Ix,p,qqq denotes the second derivative of the incomplete beta function with respect to q

Ipq

Ix,p,qpq denotes the first derivative of the incomplete beta function with respect to p and q

log.Beta

log[Beta(p,q)]

digamma.p

ψp

trigamma.p

ψp

digamma.q

ψq

trigamma.q

ψq

digamma.pq

ψp+q

trigamma.pq

ψp+q

nappx

highest order approximant evaluated. Iteration stops if nappx>maxappx

errapx

approximate maximum absolute error of computed derivatives

Arguments

x

vector of length k containing values to which the beta function is to be integrated

p

Beta shape1 parameter

q

Beta shape2 parameter. shape1 and shape2 can be vertors in the same dimension as x or scalars

err

value for error

minapp

minimal bound value

maxapp

external noud value

References

Boik, Robert J., and James F. Robison-Cox. "Derivatives of the incomplete beta function." Journal of Statistical Software 3.1 (1998): 1-20. (arXiv)