Description Usage Arguments Details Value Author(s) References See Also Examples
This function fits the empirical bivariate quantiles based on the CDF (cumulative distrubtion function). We use
linear programming. Currently, the solver is lp
from the package
lpSolve
1 |
y |
the responses in a matrix or data frame with 2 columns and rows equal to the number of observations. |
alphaseq |
The angles along which the quantile should be computed, can be a vector. If not specified, quantiles will will be computed for a equidistant grid from 0 to π/2 of length 10 is used. |
tau |
The quantile level. If not specified, the median, τ=0.5 will be computed. |
transformed |
Default is FALSE specifying that quantiles on the original scale are returned. If TRUE, quantiles on the unit square are returned in addition. |
The function imitates rotation around (1,1) in the transformed coordinate system and thus allows to estimate the marginal quantiles.
an object of class bivquant
.
Nadja Klein.
Nadja Klein and Thomas Kneib (2019). Directional Bivariate Quantiles - A Robust Approach based on the Cumulative Distribution Function. To appear in Advances in Statistical Analysis (AStA)
lp
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | require("MASS")
require("mvtnorm")
set.seed(42)
tauseq <- seq(0.1,0.9,by=0.1) #quantile levels
alphas <- seq(0*pi/32,16*pi/32,by=0.5*pi/32) #grid of angles
n <- 50 #sample size
#generate bivariate data
mu <- c(6, 10)
#correlated responses
rho <- 0.5
Sigma <- matrix(c(
1.0, rho,
rho, 1.0
),
ncol=2, byrow=TRUE)
X <- rmvnorm(n, mu, Sigma)
bivqu <- bivquant(X,alpha=alphas,tau=tauseq)
plot(bivqu, pch=20,col="grey")
#bigger n
set.seed(123)
n <- 100
X <- dgp_cop(n, family="clayton", margins=c("norm", "norm"),
paramMargins=list(list(mean = 4, sd = 1), list(mean = 4, sd = 5)),
rho=1.75)
bivqu <- bivquant(X,alpha=alphas,tau=tauseq)
plot(bivqu, pch=20,col="grey")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.