Learn R Programming

copBasic (version 1.7.1)

med.regressCOP: Perform Median Regression using a Copula by Numerical Derivative Method for V with respect to U

Description

Perform median regression (Nelsen, 2006, pp. 217--218) of a copula by inversion of numerical derivatives of the copula. See the documentation for qua.regressCOP for mathematical details. The qua.regressCOP.draw supports so-called quantile regression along numerous probability levels (see Examples).

Usage

med.regressCOP(u=seq(0.01,0.99, by=0.01), cop=NULL, para=NULL, ...)

Arguments

u
Nonexceedance probability $u$ in the $X$ direction;
cop
A copula function;
para
Vector of parameters or other data structure, if needed, to pass to the copula; and
...
Additional arguments to pass such qua.regressCOP and derCOPinv that are called in succession.

Value

  • An Rdata.frame of the median regressed probabilities of $V$ and provided $U$ values is returned.

concept

quantile regression

References

Nelsen, R.B., 2006, An introduction to copulas: New York, Springer, 269 p.

See Also

med.regressCOP2, qua.regressCOP, qua.regressCOP.draw

Examples

Run this code
theta <- 0.45
R <- med.regressCOP(cop=PLACKETTcop, para=theta)
plot(R$U,R$V, type="l", lwd=5, lty=2, xlim=c(0,1), ylim=c(0,1))
lines(R$U,(1+(theta-1)*R$U)/(theta+1), col=2)
theta <- 202
R <- med.regressCOP(cop=PLACKETTcop, para=theta)
lines(R$U,R$V, lwd=5, lty=2)
lines(R$U,(1+(theta-1)*R$U)/(theta+1), col=2)
# INDEPENDENCE YIELDS STRAIGHT LINES, RED IS THE MEDIAN REGRESSION
F <- seq(0.1, 0.9, by=0.1)
plot(c(0,1),c(0,1), type="n", lwd=3,
     xlab="U, NONEXCEEDANCE PROBABILITY", ylab="V, NONEXCEEDANCE PROBABILITY")
# Draw the regression of V on U and then U on V (swap=TRUE)
qua.regressCOP.draw(f=F, cop=P, para=NA, ploton=FALSE)
qua.regressCOP.draw(f=F, cop=P, para=NA, ploton=FALSE, swap=TRUE, lty=2)
# NEGATIVE PLACKETT THETA YIELDS CURVES DOWN TO RIGHT, RED IS THE MEDIAN REGRESSION
theta <- 0.5; F <- seq(0.1, 0.9, by=0.1)
plot(c(0,1),c(0,1), type="n", lwd=3,
     xlab="U, NONEXCEEDANCE PROBABILITY", ylab="V, NONEXCEEDANCE PROBABILITY")
# Draw the regression of V on U and then U on V (swap=TRUE)
qua.regressCOP.draw(f=F, cop=PLACKETTcop, ploton=FALSE, para=theta)
qua.regressCOP.draw(f=F, cop=PLACKETTcop, ploton=FALSE, para=theta, swap=TRUE, lty=2)

Run the code above in your browser using DataLab