scaleCurve(x, y = NULL, alpha = seq(0, 1, 0.01), method = "Projection",
name = "X", name_y = "Y", title = "Scale Curve", ...)
Arguments
x
Multivariate data as a matrix.
y
Additional matrix with multivariate data.
alpha
Vector with values of central area to be used in computation.
method
Character string which determines the depth function used. method can be "Projection" (the default), "Mahalanobis", "Euclidean" or "Tukey". For details see depth.
name
Name of matrix X used in legend.
name_y
Name of matrix Y used in legend.
title
title of the plot.
...
Any additional parameters for function depth.
Details
For sample depth function D({x},{{{Z}}^{n}}) , {x}in {{{R}}^{d}} , d≥ 2 , {Z}^{n}={{{{z}}_{1}},...,{{{z}}_{n}}}subset {{{R}}^{d}} , {{D}_{α }}({{{Z}}^{n}}) denoting α- central region, we can define the scale curve
SC(α )=≤ft( α ,vol({{D}_{α }}({{{Z}}^{n}})
ight)subset {{{R}}^{2}}, for α in [0,1]
The scale curve is a two-dimensional method of describing the dispersion of random vector around the depth induced median.
Function scalecurve for determining the volumes of the convex hull containing points from alpha central regions, uses function convhulln from geometry package.
The minimal dimension of data in X or Y is 2.
ggplot2 package is used to draw a plot.
Value
Returns the volume of the convex hull containing subsequent central points of X.
Author(s)
Daniel Kosiorowski, Mateusz Bocian, Anna Wegrzynkiewicz and Zygmunt Zawadzki from Cracow University of Economics.
References
Liu, R.Y., Parelius, J.M. and Singh, K. (1999), Multivariate analysis by data depth: Descriptive statistics, graphics and inference (with discussion), Ann. Statist., 27, 783–858.
Chaudhuri, P. (1996), On a Geometric Notion of Quantiles for Multivariate Data, Journal of the American Statistical Association, 862–872.
Dyckerhoff, R. (2004), Data Depths Satisfying the Projection Property, Allgemeines Statistisches Archiv., 88, 163–190.
See Also
depthContour and depthPersp for depth graphics.
Examples
require(mvtnorm)
x = mvrnorm(n = 100, mu = c(0,0), Sigma = 3*diag(2))
y = rmvt(n = 100, sigma = diag(2), df = 2)
scaleCurve(x, y, method = "Projection", plot = TRUE)
## comparing of two scale curves - normal distribution and mixture of normal distributions
x = mvrnorm(100, c(0,0), diag(2))
y = mvrnorm(80, c(0,0), diag(2))
z = mvrnorm(20, c(5,5), diag(2))
scaleCurve(x, rbind(y,z), method = "Projection", name = "N", name_y = "Mixture of N")
Results
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(DepthProc)
Loading required package: ggplot2
Loading required package: Rcpp
Loading required package: rrcov
Loading required package: robustbase
Scalable Robust Estimators with High Breakdown Point (version 1.3-11)
Loading required package: MASS
Loading required package: np
Nonparametric Kernel Methods for Mixed Datatypes (version 0.60-2)
[vignette("np_faq",package="np") provides answers to frequently asked questions]
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/DepthProc/scaleCurve.Rd_%03d_medium.png", width=480, height=480)
> ### Name: scaleCurve
> ### Title: Scale curve
> ### Aliases: scaleCurve
> ### Keywords: curve depth function multivariate nonparametric robust scale
>
> ### ** Examples
>
> require(mvtnorm)
Loading required package: mvtnorm
> x = mvrnorm(n = 100, mu = c(0,0), Sigma = 3*diag(2))
> y = rmvt(n = 100, sigma = diag(2), df = 2)
> scaleCurve(x, y, method = "Projection", plot = TRUE)
Object of class: ScaleCurveList> ## comparing of two scale curves - normal distribution and mixture of normal distributions
> x = mvrnorm(100, c(0,0), diag(2))
> y = mvrnorm(80, c(0,0), diag(2))
> z = mvrnorm(20, c(5,5), diag(2))
> scaleCurve(x, rbind(y,z), method = "Projection", name = "N", name_y = "Mixture of N")
Object of class: ScaleCurveList>
>
>
>
>
> dev.off()
null device
1
>