dcomperr_mv {dsfa} R Documentation

## Composed error multivariate distribution

### Description

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

### Usage

dcomperr_mv(
x1 = 0,
mu1 = 0,
sigma_v1 = 1,
par_u1 = 1,
s1 = -1,
x2 = 0,
mu2 = 0,
sigma_v2 = 1,
par_u2 = 1,
s2 = -1,
delta = 0,
family_mv = c("normhnorm", "normhnorm", "normal"),
deriv = 0,
tri = NULL,
log.p = FALSE,
check = TRUE
)

pcomperr_mv(
q1 = 0,
mu1 = 0,
sigma_v1 = 1,
par_u1 = 1,
s1 = -1,
q2 = 0,
mu2 = 0,
sigma_v2 = 1,
par_u2 = 1,
s2 = -1,
delta = 0,
family_mv = c("normhnorm", "normhnorm", "normal"),
log.p = FALSE,
check = TRUE
)

rcomperr_mv(
n,
mu1 = 0,
sigma_v1 = 1,
par_u1 = 1,
s1 = -1,
mu2 = 0,
sigma_v2 = 1,
par_u2 = 1,
s2 = -1,
delta = 0,
family_mv = c("normhnorm", "normhnorm", "normal"),
check = TRUE
)


### Arguments

 x1 vector of quantiles for margin 1. mu1 vector of \mu for margin 1. sigma_v1 vector of \sigma_V for margin 1. Must be positive. par_u1 vector of \sigma_U for margin 1. Must be positive. s1 s=-1 for production and s=1 for cost function for margin 1. x2 vector of quantiles for margin 2. mu2 vector of \mu for margin 2. sigma_v2 vector of \sigma_V for margin 2. Must be positive. par_u2 vector of \sigma_U for margin 2. Must be positive. s2 s=-1 for production and s=1 for cost function for margin 2. delta matrix of copula parameter. Must have at least one column. family_mv string vector, specifying the the margin one and two, as well as the copula. For the margins the distributions normhnorm or normexp are available. For the family_cop: independent = Independence copula normal = Gaussian copula clayton = Clayton copula gumbel = Gumbel copula frank = Frank copula joe = Joe copula deriv derivative of order deriv of the log density. Available are 0 and 2. 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. q1 vector of quantiles for margin 1. q2 vector of quantiles for margin 2. n number of observations.

### Details

A bivariate random vector (Y_1,Y_2) follows a composed error multivariate distribution f_{Y_1,Y_2}(y_1,y_2), which can be rewritten using Sklars' theorem via a copula

f_{Y_1,Y_2}(y_1,y_2)=c(F_{Y_1}(y_1),F_{Y_2}(y_2),\delta) \cdot f_{Y_1}(y_1) f_{Y_2}(y_2) \qquad,

where c(\cdot) is a copula function and F_{Y_m}(y_m),f_{Y_m}(y_m) are the marginal cdf and pdf respectively. delta is the copula parameter.

### Value

dcomperr_mv gives the density, pcomperr_mv the distribution and rcomperr_mv 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_mv(): distribution function for the composed error multivariate distribution.

• rcomperr_mv(): random number generation for the composed error multivariate 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.

### Examples

set.seed(1337)
x2<-10;x1<-5
mu2<-7;mu1<-2
sigma_v2<-6;sigma_v1<-3
par_u2<-3;par_u1<-2
s2<-s1<--1
delta<-matrix(0.5,ncol=1, nrow=100)
family_mv=c("normhnorm","normhnorm","normal")

pdf<-dcomperr_mv(x1, mu1, sigma_v1, par_u1, s1,
x2, mu2, sigma_v2, par_u2, s2,
delta[1, , drop=FALSE], family_mv, deriv = 2, tri=NULL, log.p=FALSE)

cdf<-pcomperr_mv(q1=x1, mu1, sigma_v1, par_u1, s1,
q2=x2, mu2, sigma_v2, par_u2, s2,
delta[1, , drop=FALSE], family_mv, log.p=FALSE)
r<-rcomperr_mv(n=100, mu1, sigma_v1, par_u1, s1,
mu2, sigma_v2, par_u2, s2,
delta, family_mv)



[Package dsfa version 1.0.1 Index]