Description Usage Arguments Details Value Note Author(s) References See Also Examples
Calculation of bivariate empirical subcopula matrix of given approximation order, induced partitions, standardized bivariate sample, and dependence measures for a given continuous bivariate sample.
1 |
mat.xy |
2-column matrix with bivariate observations of a continuous random vector (X,Y). |
m |
integer value of approximation order, where m = 2,...,n with n equal to sample size. |
display |
logical value indicating if graphs and dependence values should be displayed. |
Both random variables X and Y 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.
A list containing the following components:
depMon |
monotone standardized supremum distance in [-1,1]. |
depMonNonSTD |
monotone non-standardized supremum distance [min,value,max]. |
depSup |
standardized supremum distance in [0,1]. |
depSupNonSTD |
non-standardized supremum distance [min,value,max]. |
matrix |
matrix with empirical subcopula values. |
part1 |
vector with partition induced by first variable X. |
part2 |
vector with partition induced by second variable Y. |
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 (X,Y). |
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 X and Y, scatterplots of the original and the standardized bivariate sample, contour and image bivariate graphs of the empirical subcopula.
If approximation order m > 2000 calculation may take more than 2 minutes. Usually m = 50 would be enough for an acceptable approximation.
Arturo Erdely https://sites.google.com/site/arturoerdely
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.
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 | ## 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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.