dcomper_mv {dsfa} | R Documentation |
Probablitiy density function, distribution, quantile function and random number generation for the multivariate composed-error distribution
dcomper_mv(
x,
mu = matrix(c(0, 0), ncol = 2),
sigma_v = matrix(c(1, 1), ncol = 2),
sigma_u = matrix(c(1, 1), ncol = 2),
delta = matrix(0, nrow = 1),
s = c(-1, -1),
distr = c("normhnorm", "normhnorm", "normal"),
rot = 0,
deriv_order = 0,
tri = NULL,
log.p = FALSE
)
pcomper_mv(
q,
mu = matrix(c(0, 0), ncol = 2),
sigma_v = matrix(c(1, 1), ncol = 2),
sigma_u = matrix(c(1, 1), ncol = 2),
delta = 0,
s = c(-1, -1),
distr = c("normhnorm", "normhnorm", "normal"),
rot = 0,
deriv_order = 0,
tri = NULL,
log.p = FALSE
)
rcomper_mv(
n,
mu = matrix(c(0, 0), ncol = 2),
sigma_v = matrix(c(1, 1), ncol = 2),
sigma_u = matrix(c(1, 1), ncol = 2),
delta = matrix(0, nrow = 1),
s = c(-1, -1),
distr = c("normhnorm", "normhnorm", "normal"),
rot = 0
)
x |
numeric matrix of quantiles. Must have two columns. |
mu |
numeric matrix of |
sigma_v |
numeric matrix of |
sigma_u |
numeric matrix of |
delta |
numeric vector of copula parameter |
s |
integer vector of length two; each element corresponds to one marginal. |
distr |
string vector of length three; the first two elements determine the distribution of the marginals. Available are: |
rot |
integer determining the rotation for Archimedian copulas. Can be |
deriv_order |
integer; maximum order of derivative. Available are |
tri |
optional; List of objects generated by [trind_generator()]. |
log.p |
logical; if TRUE, probabilities p are given as log(p). |
q |
numeric matrix of probabilities. |
n |
positive integer; number of observations. |
A bivariate random vector (X_1,X_2)=\boldsymbol{X}
follows a multivariate composed-errordistribution f_{X_1,X_2}(x_1,x_2)
, which can be rewritten using Sklars' theorem via a copula
f_{X_1,X_2}(y_1,y_2)=c(F_{X_1}(x_1),F_{X_2}(x_2),\delta) \cdot f_{X_1}(x_1) f_{X_2}(x_2) \qquad,
where c(\cdot)
is the density of the copula and F_{X_m}(x_m)
,f_{X_m}(x_m)
are the marginal cdfs and pdfs respectively for m \in \{1,2\}
. \delta
is the copula parameter.
dcomper_mv
gives the density, pcomper_mv
give the distribution function, and rcomper_mv
generates random numbers, with given parameters.
If the derivatives are calculated the output is a derivs
object.
pcomper_mv()
: distribution function for the multivariate composed-error distribution.
rcomper_mv()
: random number generation for the multivariate composed-error distribution.
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.
Other distribution:
dcomper()
,
dnormexp()
,
dnormhnorm()
pdf <- dcomper_mv(x=matrix(c(0,10),ncol=2), mu=matrix(c(1,2),ncol=2),
sigma_v=matrix(c(3,4),ncol=2), sigma_u=matrix(c(5,6),ncol=2),
delta=c(0.5), s=c(-1,-1), distr=c("normhnorm","normhnorm","normal"),
deriv=2 ,
tri=list(trind_generator(3),trind_generator(3),trind_generator(1),
trind_generator(6),trind_generator(7)),
log.p=TRUE)
cdf <- pcomper_mv(q=matrix(c(0,10),ncol=2), mu=matrix(c(1,2),ncol=2),
sigma_v=matrix(c(3,4),ncol=2), sigma_u=matrix(c(5,6),ncol=2),
delta=c(0.5), s=c(-1,-1), distr=c("normhnorm","normhnorm","normal"))
r <- rcomper_mv(n=10, mu=matrix(c(1,2),ncol=2),
sigma_v=matrix(c(3,4),ncol=2), sigma_u=matrix(c(5,6),ncol=2),
delta=c(0.5), s=c(-1,-1), distr=c("normhnorm","normhnorm","normal"))