Learn R Programming

cSFM (version 1.1)

D.SN: Derivatives of Normalized Skewed Normal Parameterized by Shape

Description

Calculate the derivatives of Skewed Normal density with location = 0 and scale = 1 when parameterized by shape parameter. The probability density function (pdf) is a bivariate function, wrt. y and a. The first and second derivatives are calculated.

Usage

D.SN(y,a)

Arguments

y
vector or matrix of quantiles, taking values in the real line; Missing values (NA's) and Inf's are allowed
a
vector or matrix of shape parameters, taking values in the real line; should have the same dimension as y

Value

  • A list with the following components
  • snfunction value of $f(x, a)$
  • sn1the first derivative $f'(x,a)$ wrt. x
  • sn11the second derivative $f''(x,a)$ wrt. x
  • sn12the cross-partial $f''(x,a)$ wrt. x and $a$
  • sn2the first derivative $f'(x,a)$ wrt. $a$
  • sn22the second derivative $f''(x,a)$ wrt. $a$

Details

In general, a skewed normal is parameterized by three parameters (location, scale, shape). It is referred as normalized skewed normal distribution in some cases when location = 0 and scale = 1. A normalized skewed normal distribution with location = 0 and scale = 1 has the density $$f(x, a) = 2 \phi(x) \Phi(x * a),$$ where a is the shape parameter; here $\phi$ is the pdf of the standard normal distribution, and $\Phi$ is the corresponding cdf. The function D.SN(x,a) calculates the function value of $f(x,a)$, along with the first and second order derivatives.

References

[1]. Azzalini, A. (1985). A class of distributions which includes the normal ones. Scandinavian Journal of Statistics, 171-178.

[2]. http://azzalini.stat.unipd.it/SN/Intro/intro.html{ A very brief introduction to the skew-normal distribution}

See Also

skewness.cp, shape.dp, dsn

Examples

Run this code
ret1 <- D.SN(0.1, 10)   # y = 0.1, a = 10
ret2 <- D.SN(-0.1, -10) # y = -0.1, a = 10
ret3 <- D.SN(rnorm(10), rnorm(10))   # y and a are a vector
# y and a are matrices
ret4 <- D.SN(matrix(rnorm(10), 2, 5), matrix(rnorm(10), 2, 5))

Run the code above in your browser using DataLab