Learn R Programming

sn (version 0.30)

zeta: Function `log(2*P(x))' and its derivatives

Description

The function log(2 P(x)) and its derivatives up to order 4, if P(x) denotes the standard normal distribution function.

Usage

zeta(k, x)

Arguments

k
an integer scalar between 0 and 4.
x
a vector. Missing values (NAs) are allowed, but Infs are not.

Value

  • a vector; this is the k-th order derivative evaluated at x

Details

k denotes the order of the derivative. If k is 0, the function is evaluated, using pnorm(x) for x>-35, an asymptotic expansion otherwise. For k between 1 and 4, the derivative of that order is evaluated. If k>4, an error message is issued.

This function is used by sn.dev and msn.dev, among others.

See Also

sn.mle, msn.mle

Examples

Run this code
y <- zeta(2,seq(-20,20,by=0.5))

for(i in 0:4) 
      curve(zeta(i,x),-1, 4, col = i+1, add = i > 0)

Run the code above in your browser using DataLab