Learn R Programming

dsfa (version 2.0.2)

dnormhnorm: Normal-halfnormal distribution

Description

Probablitiy density function, distribution, quantile function and random number generation for the normal-halfnormal distribution

Usage

dnormhnorm(
  x,
  mu = 0,
  sigma_v = 1,
  sigma_u = 1,
  s = -1,
  deriv_order = 0,
  tri = NULL,
  log.p = FALSE
)

pnormhnorm( q, mu = 0, sigma_v = 1, sigma_u = 1, s = -1, deriv_order = 0, tri = NULL, log.p = FALSE )

qnormhnorm(p, mu = 0, sigma_v = 1, sigma_u = 1, s = -1)

rnormhnorm(n, mu = 0, sigma_v = 1, sigma_u = 1, s = -1)

Value

dnormhnorm() gives the density, pnormhnorm() give the distribution function, qnormhnorm() gives the quantile function, and rnormhnorm() generates random numbers, with given parameters. dnormhnorm() and pnormhnorm() return a derivs object. For more details see trind and trind_generator.

Arguments

x

numeric vector of quantiles.

mu

numeric vector of \(\mu\).

sigma_v

numeric vector of \(\sigma_V\). Must be positive.

sigma_u

numeric vector of \(\sigma_U\). Must be positive.

s

integer; \(s=-1\) for production and \(s=1\) for cost function.

deriv_order

integer; maximum order of derivative. Available are 0,2 and 4.

tri

optional; index matrix for upper triangular, generated by trind_generator.

log.p

logical; if TRUE, probabilities p are given as log(p).

q

numeric vector of quantiles.

p

numeric vector of probabilities.

n

positive integer; number of observations.

Functions

  • pnormhnorm(): distribution function for the normal-halfnormal distribution.

  • qnormhnorm(): quantile function for the normal-halfnormal distribution.

  • rnormhnorm(): random number generation for the normal-halfnormal distribution.

Details

A random variable \(X\) follows a normal-halfnormal distribution if \(X = V + s \cdot U \), where \(V \sim N(\mu, \sigma_V^2)\) and \(U \sim HN(\sigma_U^2)\). The density is given by $$f_X(x)=\frac{1}{\sqrt{\sigma_V^2+\sigma_U^2}} \phi(\frac{x-\mu}{\sqrt{\sigma_V^2+\sigma_U^2}}) \Phi(s \frac{\sigma_U}{\sigma_V} \frac{x-\mu}{\sqrt{\sigma_V^2+\sigma_U^2}}) \qquad,$$ where \(s=-1\) for production and \(s=1\) for cost function.

References

  • aigner1977formulationdsfa

  • kumbhakar2015practitionerdsfa

  • schmidt2020analyticdsfa

  • gradshteyn2014tabledsfa

  • azzalini2013skewdsfa

See Also

Other distribution: dcomper_mv(), dcomper(), dnormexp()

Examples

Run this code
pdf <- dnormhnorm(x=5, mu=1, sigma_v=2, sigma_u=3, s=-1)
cdf <- pnormhnorm(q=5, mu=1, sigma_v=2, sigma_u=3, s=-1)
q <- qnormhnorm(p=seq(0.1, 0.9, by=0.1), mu=1, sigma_v=2, sigma_u=3, s=-1)
r <- rnormhnorm(n=10, mu=1, sigma_v=2, sigma_u=3, s=-1)

Run the code above in your browser using DataLab