dcomperr {dsfa} R Documentation

## Composed error term distribution

### Description

Probablitiy density, distribution, quantile function and random number generation for the composed error term distribution.

### Usage

dcomperr(
x = 0,
mu = 0,
sigma_v = 1,
par_u = 1,
s = -1,
family = "normhnorm",
deriv = 0,
tri = NULL,
log.p = FALSE,
check = TRUE
)

pcomperr(
q,
mu = 0,
sigma_v = 1,
par_u = 1,
s = -1,
family = "normhnorm",
deriv = 0,
tri = NULL,
lower.tail = TRUE,
log.p = FALSE,
check = TRUE
)

qcomperr(
p,
mu = 0,
sigma_v = 1,
par_u = 1,
s = -1,
family = "normhnorm",
lower.tail = TRUE,
log.p = FALSE,
check = TRUE
)

rcomperr(
n,
mu = 0,
sigma_v = 1,
par_u = 1,
s = -1,
family = "normhnorm",
check = TRUE
)


### Arguments

 x vector of quantiles. mu vector of \mu sigma_v vector of \sigma_V. Must be positive. par_u vector of parameter of the (in)efficiency term. Must be positive. s s=-1 for production and s=1 for cost function. family normhnorm for normal-halfnormal and normexp for normal-exponential distribution. deriv derivative of order deriv of the log density. Available are 0,2 and 4. tri optional, index arrays for upper triangular matrices, generated by trind.generator() and supplied to chainrule(). log.p logical; if TRUE, probabilities p are given as log(p). check logical; if TRUE, check inputs. q vector of quantiles. lower.tail logical; if TRUE (default), probabilities are P[X \le x] otherwise, P[X > x]. p vector of probabilities. n number of observations.

### Details

This is wrapper function for the normal-halfnormal and normal-exponential distribution. A random variable \mathcal{E} follows a composed error distribution if \mathcal{E} = V + s \cdot U , where V \sim N(\mu, \sigma_V^2) and U \sim HN(0,\sigma_U^2) or U \sim Exp(0,\sigma_U^2). For more details see dnormhnorm and dnormexp. Here, s=-1 for production and s=1 for cost function.

### Value

dcomperr gives the density, pcomperr gives the distribution function, qcomperr gives the quantile function, and rcomperr generates random numbers, with given parameters. If the derivatives are calculated these are provided as the attributes gradient, hessian, l3 and l4 of the output of the density.

### Functions

• pcomperr(): distribution function for the composed error distribution.

• qcomperr(): quantile function for the composed error distribution.

• rcomperr(): random number generation for the composed error distribution.

### References

• Aigner D, Lovell CK, Schmidt P (1977). “Formulation and estimation of stochastic frontier production function models.” Journal of econometrics, 6(1), 21–37.

• Kumbhakar SC, Wang H, Horncastle AP (2015). A practitioner's guide to stochastic frontier analysis using Stata. Cambridge University Press.

• Schmidt R, Kneib T (2020). “Analytic expressions for the Cumulative Distribution Function of the Composed Error Term in Stochastic Frontier Analysis with Truncated Normal and Exponential Inefficiencies.” arXiv preprint arXiv:2006.03459.

• Gradshteyn IS, Ryzhik IM (2014). Table of integrals, series, and products. Academic press.

• Azzalini A (2013). The skew-normal and related families, volume 3. Cambridge University Press.

### Examples

pdf <- dcomperr(x=seq(-3, 3, by=0.1), mu=1, sigma_v=2, par_u=3, s=-1, family="normhnorm")
cdf <- pcomperr(q=seq(-3, 3, by=0.1), mu=1, sigma_v=2, par_u=3, s=-1, family="normhnorm")
q <- qcomperr(p=seq(0.1, 0.9, by=0.1), mu=1, sigma_v=2, par_u=3, s=-1, family="normhnorm")
r <- rcomperr(n=100, mu=1, sigma_v=2, par_u=3, s=-1, family="normhnorm")



[Package dsfa version 1.0.1 Index]