Learn R Programming

dual (version 0.0.5)

Special: Special Functions of Mathematics

Description

Special mathematical functions related to the beta and gamma.

Usage

# S4 method for dual,dual
beta(a, b)

# S4 method for dual,numeric beta(a, b)

# S4 method for numeric,dual beta(a, b)

# S4 method for dual,dual lbeta(a, b)

# S4 method for dual,numeric lbeta(a, b)

# S4 method for numeric,dual lbeta(a, b)

# S4 method for dual gamma(x)

# S4 method for dual lgamma(x)

# S4 method for dual psigamma(x, deriv = 0L)

# S4 method for dual digamma(x)

# S4 method for dual trigamma(x)

# S4 method for dual,dual choose(n, k)

# S4 method for numeric,dual choose(n, k)

# S4 method for dual,numeric choose(n, k)

# S4 method for dual,dual lchoose(n, k)

# S4 method for numeric,dual lchoose(n, k)

# S4 method for dual,numeric lchoose(n, k)

# S4 method for dual factorial(x)

# S4 method for dual lfactorial(x)

Value

A dual object containing the transformed values according to the chosen function.

Arguments

a

non-negative numeric value or dual object with non-negative real part.

b

non-negative numeric value or dual object with non-negative real part.

x

dual object or numeric value.

deriv

integer value.

n

dual object or numeric value.

k

dual object or numeric value.

Examples

Run this code
x <- dual(0.5, 1)
a <- dual(1.2, 1:0)
b <- dual(2.1, 0:1)

beta(a, b)
beta(1, b)
beta(a, 1)
lbeta(a, b)
lbeta(1, b)
lbeta(a, 1)

gamma(x)
lgamma(x)
psigamma(x, deriv = 0)
digamma(x)
trigamma(x)
psigamma(x, 2)
psigamma(x, 3)


n <- 7.8 + a
k <- 5.6 + b
choose(n, k)
choose(5, k)
choose(n, 2)

lchoose(n, k)
lchoose(5, k)
lchoose(n, 2)

factorial(x)
lfactorial(x)

Run the code above in your browser using DataLab