Learn R Programming

cSFM (version 1.1)

SSN: Standard Skewed Normal Parameterized using Skewness.

Description

Calculate the density function, log density function, and derivatives of the standard skewed normal (SSN) distribution parameterized using skewness.

Usage

g(y, gamma, log = FALSE)
D.lg(y, gamma)

Arguments

y
function arigument, taking values in the real line
gamma
skewness parameter; should have the same dimension as y
log
logical; if TRUE, the log of g(y, gamma) is given

Value

  • g(y, gamma) gives the pdf value at y and gamma as the skewness; g(y, gamma, log = TRUE) gives the log of the pdf value at y and gamma as the skewness; D.lg(y, gamma) gives the list of derivatives of the log pdf at y and gamma with the following components:
  • D11st derivative of log.g(y,gamma) wrt. y
  • D21st derivative of log.g(y,gamma) wrt. gamma
  • D122nd cross-partial derivative of log.g(y,gamma) wrt. y and gamma
  • D112nd derivative of log.g(y,gamma) wrt. y
  • D222nd derivative of log.g(y,gamma) wrt. gamma

Details

Calculate the pdf (probability density function) and derivatives of standard skewed normal when parameterized by skewness.

See Also

D.SN, shape.dp, skewness.cp, D.gamma

Examples

Run this code
# pdf of SSN
ret1 <- g(seq(-3, 3, length = 100), 0.9)  
# plot the pdf
plot(seq(-3, 3, length = 100), ret1, type = "l", 
     xlab = "x", ylab = "pdf", main = "Plot of Stardard Skewed Normal Density")
# derivatives of pdf 
ret2 <- D.lg(10, 0.5) 
# y and a are a vector
ret3 <- D.lg(rnorm(10), seq(0.1,0.5,length = 10))   
# y and a are matrices
ret4 <- D.lg(matrix(rnorm(10), 2, 5), matrix(seq(0.1,0.5,length = 10), 2, 5))

Run the code above in your browser using DataLab