dcomper_mv {dsfa}R Documentation

Multivariate Composed-Error distribution

Description

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

Usage

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
)

Arguments

x

numeric matrix of quantiles. Must have two columns.

mu

numeric matrix of \mu. Must have two columns.

sigma_v

numeric matrix of \sigma_V. Must be positive and have two columns.

sigma_u

numeric matrix of \sigma_U. Must be positive and have two columns.

delta

numeric vector of copula parameter \delta.

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:
'normhnorm', Normal-halfnormal distribution
'normexp', Normal-exponential distribution
The last element determines the distribution of the copula:
'independent', Independence copula
'normal', Gaussian copula
'clayton', Clayton copula
'gumbel', Gumbel copula
'frank', Frank copula
'joe', Joe copula
'amh', Ali-Mikhail-Haq copula

rot

integer determining the rotation for Archimedian copulas. Can be 90, 180 or 270.

deriv_order

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

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.

Details

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.

Value

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.

Functions

References

See Also

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

Examples

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"))


[Package dsfa version 2.0.2 Index]