dnormexp {dsfa}R Documentation

Normal-Exponential distribution

Description

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

Usage

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

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

qnormexp(p, mu = 0, sigma_v = 1, sigma_u = 1, s = -1, log.p = FALSE)

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

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.

Details

A random variable X follows a normal-exponential distribution if X = V + s \cdot U , where V \sim N(\mu, \sigma_V^2) and U \sim Exp(\sigma_U). The density is given by

f_X(x)=\frac{\sigma_U}{2} \exp \{\sigma_U (s \mu) + \frac{1}{2} \sigma_U^2 \sigma_V^2-\sigma_U (s x) \} 2 \Phi(\frac{1}{\sigma_V} (-s \mu)-\sigma_U \sigma_V+\frac{1}{\sigma_V}(s x)) \qquad,

where s=-1 for production and s=1 for cost function. In the latter case the distribution is equivalent to the Exponentially modified Gaussian distribution. '

Value

dnormexp() gives the density, pnormexp() give the distribution function, qnormexp() gives the quantile function, and rnormexp() generates random numbers, with given parameters. dnormexp() and pnormexp() return a derivs object. For more details see trind and trind_generator.

Functions

References

See Also

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

Examples

pdf <- dnormexp(x=5, mu=1, sigma_v=2, sigma_u=3, s=-1)
cdf <- pnormexp(q=5, mu=1, sigma_v=2, sigma_u=3, s=-1)
q <- qnormexp(p=seq(0.1, 0.9, by=0.1), mu=1, sigma_v=2, sigma_u=3, s=-1)
r <- rnormexp(n=10, mu=1, sigma_v=2, sigma_u=3, s=-1)


[Package dsfa version 2.0.2 Index]