subcopemc {subcopem2D} | R Documentation |
Bivariate Empirical Sucopula of Given Approximation Order
Description
Calculation of bivariate empirical subcopula matrix of given approximation order, induced partitions, standardized bivariate sample, and dependence measures for a given continuous bivariate sample.
Usage
subcopemc(mat.xy, m = nrow(mat.xy), display = FALSE)
Arguments
mat.xy |
2-column matrix with bivariate observations of a continuous random vector |
m |
integer value of approximation order, where |
display |
logical value indicating if graphs and dependence values should be displayed. |
Details
Both random variables and
must be continuous, and therefore repeated values in the sample are not expected. If found,
jitter
will be applied to break ties. NA values are not allowed.
Value
A list containing the following components:
depMon |
monotone standardized supremum distance in |
depMonNonSTD |
monotone non-standardized supremum distance |
depSup |
standardized supremum distance in |
depSupNonSTD |
non-standardized supremum distance |
matrix |
matrix with empirical subcopula values. |
part1 |
vector with partition induced by first variable |
part2 |
vector with partition induced by second variable |
sample.size |
numeric value of sample size. |
order |
numeric value of approximation order. |
std.sample |
2-column matrix with the standardized bivariate sample. |
sample |
2-column matrix with the original bivariate sample of |
If display = TRUE
then the values of depMon
, depMonNonSTD
, depSup
, and depSupNonSTD
will be displayed, and the following graphs will be generated: marginal histograms of and
, scatterplots of the original and the standardized bivariate sample, contour and image bivariate graphs of the empirical subcopula.
Note
If approximation order calculation may take more than 2 minutes. Usually
would be enough for an acceptable approximation.
Author(s)
Arturo Erdely https://sites.google.com/site/arturoerdely
References
Durante, F. and Sempi, C. (2016) Principles of Copula Theory. Taylor and Francis Group, Boca Raton.
Erdely, A. (2017) A subcopula based dependence measure. Kybernetika 53(2), 231-243. DOI: 10.14736/kyb-2017-2-0231
Nelsen, R.B. (2006) An Introduction to Copulas. Springer, New York.
See Also
Examples
## Example 1: Independent Normal and Gamma
n <- 300 # sample size
X <- rnorm(n) # Normal(0,1)
Y <- rgamma(n, 2, 3) # Gamma(2,3)
XY <- cbind(X, Y) # 2-column matrix with bivariate sample
cor(XY, method = "pearson")[1, 2] # Pearson's correlation
cor(XY, method = "spearman")[1, 2] # Spearman's correlation
cor(XY, method = "kendall")[1, 2] # Kendall's correlation
SC <- subcopemc(XY,, display = TRUE)
str(SC)
## Approximation of order m = 15
SCm15 <- subcopemc(XY, 15, display = TRUE)
str(SCm15)
## Example 2: Non-monotone dependence
n <- 300 # sample size
Theta <- runif(n, 0, 2*pi) # Uniform circular distribution
X <- cos(Theta)
Y <- sin(Theta)
XY <- cbind(X, Y) # 2-column matrix with bivariate sample
cor(XY, method = "pearson")[1, 2] # Pearson's correlation
cor(XY, method = "spearman")[1, 2] # Spearman's correlation
cor(XY, method = "kendall")[1, 2] # Kendall's correlation
SC <- subcopemc(XY,, display = TRUE)
str(SC)
## Approximation of order m = 15
SCm15 <- subcopemc(XY, 15, display = TRUE)
str(SCm15)