depthTukey: Tukey Depth

Description Usage Arguments Details Author(s) Examples

Description

Computes the Tukey depth of a point or vectors of points with respect to a multivariate data set.

Usage

1
2
depthTukey(u, X, ndir = 1000, name = "X", threads = -1, exact = FALSE,
  ...)

Arguments

u

Numerical vector or matrix whose depth is to be calculated. Dimension has to be the same as that of the observations.

X

The data as a matrix, data frame or list. If it is a matrix or data frame, then each row is viewed as one multivariate observation. If it is a list, all components must be numerical vectors of equal length (coordinates of observations).

ndir

number of directions used in computations

name

name for this data set - it will be used on plots from depthproc.

threads

number of threads used in parallel computations. Default value -1 means that all possible cores will be used.

exact

if TRUE exact alhorithm will be used . Currently it works only for 2 dimensional data set.

...

currently not supported.

Details

Irrespective of dimension, Projection and Tukey's depth is obtained by approximate calculation.

Returns the depth of multivariate point u with respect to data set X.

Author(s)

Daniel Kosiorowski, Mateusz Bocian, Anna Wegrzynkiewicz and Zygmunt Zawadzki from Cracow University of Economics.

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
 x = matrix(rnorm(3000), nc = 3)
 depthTukey(x, ndir = 2000)
 
## End(Not run)

 # Exact algorithm in 2d
 x = matrix(rnorm(2000), nc = 2)
 depthTukey(x, exact = TRUE)

Example output

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.4-3)

Loading required package: MASS
Loading required package: np
Nonparametric Kernel Methods for Mixed Datatypes (version 0.60-3)
[vignette("np_faq",package="np") provides answers to frequently asked questions]
[vignette("np",package="np") an overview]
[vignette("entropy_np",package="np") an overview of entropy-based methods]

Attaching package: 'DepthProc'

The following object is masked from 'package:base':

    as.matrix

Depth method:  Tukey 
   [1] 0.048 0.172 0.086 0.098 0.033 0.002 0.183 0.036 0.230 0.249 0.078 0.025
  [13] 0.220 0.166 0.139 0.077 0.047 0.024 0.000 0.131 0.023 0.076 0.177 0.034
  [25] 0.228 0.016 0.126 0.006 0.214 0.006 0.164 0.102 0.105 0.050 0.015 0.048
  [37] 0.010 0.218 0.203 0.095 0.021 0.116 0.002 0.155 0.078 0.050 0.015 0.020
  [49] 0.088 0.032 0.380 0.171 0.073 0.121 0.019 0.011 0.099 0.018 0.052 0.180
  [61] 0.082 0.373 0.000 0.039 0.015 0.211 0.040 0.008 0.008 0.000 0.174 0.027
  [73] 0.007 0.006 0.173 0.102 0.028 0.221 0.045 0.140 0.042 0.029 0.085 0.141
  [85] 0.114 0.099 0.166 0.004 0.130 0.004 0.115 0.043 0.179 0.105 0.159 0.007
  [97] 0.026 0.208 0.089 0.034 0.000 0.022 0.000 0.035 0.002 0.029 0.000 0.140
 [109] 0.114 0.000 0.278 0.089 0.192 0.185 0.015 0.031 0.033 0.052 0.125 0.000
 [121] 0.005 0.112 0.063 0.009 0.104 0.138 0.208 0.074 0.000 0.029 0.039 0.217
 [133] 0.242 0.004 0.084 0.244 0.229 0.179 0.045 0.096 0.096 0.085 0.068 0.020
 [145] 0.196 0.050 0.029 0.100 0.079 0.024 0.263 0.003 0.096 0.004 0.292 0.051
 [157] 0.131 0.047 0.113 0.018 0.054 0.002 0.028 0.170 0.053 0.120 0.037 0.220
 [169] 0.055 0.025 0.166 0.028 0.003 0.044 0.021 0.080 0.107 0.161 0.023 0.002
 [181] 0.011 0.197 0.018 0.063 0.168 0.032 0.008 0.000 0.065 0.013 0.263 0.021
 [193] 0.127 0.168 0.197 0.021 0.002 0.050 0.146 0.022 0.043 0.042 0.006 0.043
 [205] 0.008 0.221 0.333 0.002 0.001 0.026 0.013 0.006 0.047 0.025 0.224 0.037
 [217] 0.080 0.037 0.189 0.038 0.150 0.003 0.135 0.063 0.002 0.151 0.023 0.026
 [229] 0.019 0.004 0.194 0.079 0.009 0.257 0.259 0.108 0.133 0.143 0.134 0.007
 [241] 0.215 0.237 0.068 0.211 0.212 0.204 0.014 0.048 0.112 0.040 0.027 0.000
 [253] 0.004 0.250 0.022 0.116 0.137 0.041 0.003 0.058 0.017 0.014 0.014 0.106
 [265] 0.136 0.117 0.042 0.150 0.150 0.004 0.000 0.006 0.168 0.004 0.008 0.053
 [277] 0.050 0.067 0.005 0.215 0.014 0.000 0.035 0.022 0.213 0.043 0.014 0.102
 [289] 0.088 0.029 0.219 0.022 0.015 0.192 0.344 0.061 0.018 0.035 0.200 0.029
 [301] 0.058 0.015 0.371 0.082 0.002 0.031 0.062 0.026 0.094 0.000 0.019 0.001
 [313] 0.410 0.081 0.059 0.033 0.040 0.006 0.046 0.076 0.049 0.028 0.051 0.068
 [325] 0.008 0.024 0.002 0.051 0.021 0.280 0.107 0.036 0.002 0.172 0.043 0.161
 [337] 0.326 0.150 0.017 0.193 0.011 0.027 0.016 0.007 0.055 0.214 0.003 0.164
 [349] 0.069 0.033 0.151 0.050 0.094 0.056 0.174 0.164 0.180 0.272 0.111 0.010
 [361] 0.359 0.001 0.020 0.027 0.028 0.018 0.022 0.277 0.255 0.002 0.072 0.001
 [373] 0.279 0.239 0.078 0.011 0.077 0.072 0.302 0.178 0.034 0.103 0.019 0.056
 [385] 0.021 0.028 0.227 0.031 0.006 0.008 0.002 0.133 0.023 0.091 0.023 0.222
 [397] 0.004 0.421 0.040 0.223 0.125 0.052 0.078 0.005 0.113 0.089 0.079 0.109
 [409] 0.062 0.007 0.000 0.086 0.079 0.195 0.028 0.065 0.106 0.181 0.001 0.135
 [421] 0.197 0.073 0.124 0.070 0.127 0.125 0.066 0.012 0.279 0.016 0.197 0.045
 [433] 0.156 0.004 0.119 0.000 0.055 0.233 0.072 0.003 0.033 0.013 0.064 0.052
 [445] 0.024 0.175 0.108 0.225 0.083 0.028 0.059 0.026 0.024 0.075 0.105 0.055
 [457] 0.186 0.130 0.000 0.239 0.030 0.055 0.154 0.084 0.127 0.105 0.017 0.031
 [469] 0.000 0.037 0.019 0.002 0.010 0.036 0.038 0.094 0.002 0.023 0.338 0.024
 [481] 0.053 0.077 0.167 0.007 0.008 0.044 0.005 0.059 0.070 0.131 0.172 0.049
 [493] 0.013 0.049 0.251 0.130 0.371 0.030 0.053 0.112 0.055 0.000 0.039 0.022
 [505] 0.049 0.064 0.004 0.083 0.042 0.016 0.099 0.000 0.272 0.046 0.045 0.011
 [517] 0.221 0.051 0.000 0.275 0.003 0.018 0.011 0.041 0.217 0.023 0.043 0.064
 [529] 0.082 0.058 0.027 0.161 0.056 0.044 0.057 0.002 0.017 0.035 0.177 0.006
 [541] 0.053 0.080 0.128 0.002 0.071 0.226 0.059 0.168 0.151 0.050 0.118 0.082
 [553] 0.116 0.231 0.037 0.289 0.122 0.057 0.042 0.080 0.212 0.098 0.096 0.080
 [565] 0.042 0.018 0.128 0.148 0.102 0.095 0.050 0.135 0.031 0.014 0.290 0.242
 [577] 0.412 0.017 0.306 0.007 0.009 0.054 0.004 0.024 0.016 0.023 0.029 0.192
 [589] 0.141 0.073 0.068 0.071 0.205 0.214 0.010 0.377 0.289 0.273 0.331 0.001
 [601] 0.003 0.351 0.052 0.026 0.288 0.003 0.034 0.022 0.224 0.165 0.047 0.191
 [613] 0.019 0.294 0.092 0.110 0.085 0.033 0.004 0.202 0.069 0.000 0.029 0.080
 [625] 0.165 0.000 0.037 0.323 0.015 0.016 0.353 0.012 0.180 0.042 0.030 0.070
 [637] 0.004 0.007 0.000 0.010 0.029 0.057 0.013 0.186 0.146 0.092 0.078 0.153
 [649] 0.017 0.084 0.168 0.004 0.014 0.170 0.110 0.075 0.012 0.004 0.157 0.001
 [661] 0.253 0.124 0.029 0.153 0.079 0.061 0.007 0.011 0.061 0.097 0.000 0.044
 [673] 0.120 0.070 0.184 0.174 0.005 0.002 0.014 0.055 0.061 0.050 0.202 0.044
 [685] 0.087 0.001 0.004 0.117 0.056 0.117 0.083 0.219 0.026 0.165 0.200 0.064
 [697] 0.042 0.015 0.132 0.094 0.076 0.000 0.003 0.124 0.132 0.041 0.231 0.082
 [709] 0.134 0.053 0.000 0.212 0.083 0.013 0.082 0.146 0.037 0.086 0.011 0.242
 [721] 0.028 0.013 0.037 0.226 0.046 0.041 0.047 0.093 0.119 0.293 0.047 0.075
 [733] 0.045 0.215 0.030 0.070 0.103 0.000 0.025 0.041 0.262 0.079 0.073 0.033
 [745] 0.051 0.010 0.019 0.062 0.053 0.027 0.156 0.045 0.020 0.155 0.036 0.059
 [757] 0.056 0.265 0.084 0.038 0.093 0.106 0.068 0.000 0.161 0.176 0.136 0.002
 [769] 0.010 0.014 0.210 0.030 0.090 0.087 0.071 0.134 0.294 0.111 0.010 0.028
 [781] 0.004 0.001 0.067 0.000 0.205 0.205 0.004 0.049 0.292 0.138 0.021 0.018
 [793] 0.100 0.181 0.258 0.148 0.077 0.041 0.009 0.215 0.140 0.042 0.063 0.024
 [805] 0.166 0.128 0.013 0.026 0.103 0.081 0.091 0.148 0.140 0.155 0.101 0.149
 [817] 0.013 0.043 0.082 0.005 0.283 0.016 0.035 0.127 0.162 0.114 0.113 0.100
 [829] 0.009 0.155 0.232 0.062 0.128 0.007 0.022 0.104 0.002 0.035 0.032 0.169
 [841] 0.059 0.433 0.013 0.127 0.001 0.128 0.026 0.098 0.284 0.003 0.009 0.053
 [853] 0.307 0.106 0.298 0.012 0.069 0.124 0.036 0.219 0.122 0.024 0.106 0.057
 [865] 0.170 0.219 0.010 0.025 0.027 0.318 0.286 0.081 0.050 0.063 0.035 0.056
 [877] 0.032 0.229 0.016 0.157 0.016 0.005 0.037 0.239 0.193 0.017 0.085 0.032
 [889] 0.002 0.002 0.023 0.087 0.120 0.001 0.017 0.029 0.069 0.136 0.137 0.094
 [901] 0.009 0.009 0.128 0.116 0.174 0.173 0.040 0.027 0.008 0.096 0.015 0.052
 [913] 0.319 0.245 0.101 0.049 0.002 0.000 0.054 0.003 0.007 0.079 0.000 0.000
 [925] 0.001 0.004 0.024 0.017 0.019 0.276 0.056 0.178 0.201 0.064 0.015 0.262
 [937] 0.179 0.000 0.062 0.278 0.109 0.260 0.254 0.155 0.074 0.165 0.000 0.063
 [949] 0.170 0.222 0.015 0.033 0.099 0.008 0.003 0.033 0.010 0.000 0.367 0.066
 [961] 0.059 0.213 0.156 0.098 0.007 0.191 0.000 0.007 0.047 0.041 0.006 0.028
 [973] 0.028 0.044 0.305 0.039 0.063 0.026 0.252 0.001 0.039 0.036 0.072 0.035
 [985] 0.057 0.157 0.204 0.146 0.024 0.000 0.148 0.001 0.023 0.184 0.003 0.106
 [997] 0.062 0.235 0.322 0.046
Depth method:  Tukey 
   [1] 0.383 0.018 0.109 0.189 0.018 0.094 0.087 0.240 0.374 0.209 0.014 0.232
  [13] 0.308 0.344 0.123 0.034 0.212 0.024 0.456 0.197 0.384 0.276 0.004 0.136
  [25] 0.291 0.026 0.139 0.104 0.021 0.345 0.164 0.064 0.037 0.234 0.143 0.318
  [37] 0.026 0.446 0.155 0.024 0.218 0.022 0.185 0.115 0.176 0.216 0.049 0.069
  [49] 0.327 0.005 0.282 0.052 0.218 0.063 0.011 0.138 0.136 0.029 0.018 0.106
  [61] 0.267 0.140 0.231 0.124 0.003 0.099 0.111 0.078 0.002 0.237 0.180 0.401
  [73] 0.286 0.211 0.054 0.093 0.105 0.100 0.229 0.074 0.015 0.061 0.001 0.086
  [85] 0.261 0.182 0.145 0.016 0.398 0.042 0.177 0.111 0.071 0.295 0.165 0.054
  [97] 0.034 0.145 0.325 0.101 0.088 0.309 0.008 0.017 0.182 0.408 0.257 0.085
 [109] 0.054 0.296 0.212 0.194 0.224 0.079 0.093 0.009 0.177 0.280 0.274 0.029
 [121] 0.111 0.174 0.402 0.082 0.124 0.195 0.007 0.026 0.089 0.232 0.160 0.306
 [133] 0.092 0.311 0.020 0.426 0.003 0.006 0.047 0.029 0.059 0.056 0.053 0.421
 [145] 0.003 0.307 0.065 0.252 0.008 0.027 0.227 0.028 0.042 0.065 0.065 0.002
 [157] 0.166 0.007 0.142 0.341 0.122 0.163 0.155 0.304 0.050 0.010 0.280 0.022
 [169] 0.144 0.038 0.119 0.019 0.193 0.057 0.027 0.294 0.012 0.205 0.059 0.260
 [181] 0.080 0.055 0.256 0.259 0.252 0.371 0.063 0.115 0.019 0.223 0.365 0.040
 [193] 0.184 0.306 0.297 0.088 0.051 0.225 0.261 0.055 0.307 0.386 0.059 0.029
 [205] 0.171 0.130 0.034 0.010 0.186 0.001 0.189 0.017 0.009 0.020 0.031 0.126
 [217] 0.351 0.341 0.028 0.012 0.076 0.039 0.137 0.025 0.389 0.206 0.148 0.061
 [229] 0.011 0.063 0.080 0.126 0.454 0.323 0.025 0.132 0.072 0.196 0.357 0.094
 [241] 0.077 0.128 0.315 0.101 0.265 0.036 0.026 0.163 0.353 0.001 0.009 0.076
 [253] 0.101 0.015 0.300 0.030 0.327 0.037 0.009 0.054 0.074 0.014 0.023 0.375
 [265] 0.365 0.220 0.014 0.068 0.074 0.131 0.114 0.026 0.220 0.065 0.067 0.148
 [277] 0.075 0.045 0.001 0.174 0.039 0.089 0.005 0.215 0.011 0.222 0.161 0.007
 [289] 0.015 0.004 0.129 0.380 0.198 0.054 0.143 0.261 0.056 0.147 0.082 0.008
 [301] 0.204 0.054 0.001 0.048 0.353 0.274 0.153 0.177 0.015 0.269 0.081 0.217
 [313] 0.007 0.080 0.114 0.007 0.094 0.149 0.065 0.328 0.362 0.361 0.011 0.111
 [325] 0.187 0.017 0.059 0.156 0.102 0.141 0.145 0.199 0.154 0.135 0.021 0.226
 [337] 0.089 0.268 0.277 0.183 0.140 0.088 0.095 0.165 0.298 0.064 0.090 0.237
 [349] 0.300 0.112 0.080 0.037 0.257 0.138 0.027 0.036 0.346 0.173 0.149 0.019
 [361] 0.104 0.138 0.095 0.191 0.236 0.134 0.442 0.031 0.035 0.364 0.045 0.132
 [373] 0.239 0.006 0.053 0.046 0.073 0.048 0.315 0.028 0.133 0.239 0.001 0.014
 [385] 0.255 0.016 0.044 0.258 0.009 0.223 0.046 0.239 0.025 0.262 0.257 0.270
 [397] 0.105 0.255 0.046 0.258 0.165 0.103 0.027 0.135 0.012 0.122 0.191 0.318
 [409] 0.191 0.006 0.125 0.127 0.142 0.198 0.180 0.001 0.217 0.277 0.017 0.090
 [421] 0.150 0.202 0.209 0.079 0.363 0.003 0.302 0.227 0.122 0.142 0.013 0.010
 [433] 0.009 0.082 0.128 0.064 0.043 0.006 0.287 0.001 0.030 0.051 0.130 0.015
 [445] 0.075 0.224 0.123 0.178 0.177 0.058 0.084 0.024 0.090 0.229 0.178 0.219
 [457] 0.370 0.074 0.032 0.051 0.040 0.233 0.039 0.043 0.328 0.129 0.347 0.381
 [469] 0.175 0.226 0.336 0.072 0.162 0.010 0.320 0.078 0.308 0.204 0.023 0.036
 [481] 0.065 0.229 0.326 0.287 0.110 0.170 0.163 0.346 0.038 0.014 0.047 0.255
 [493] 0.265 0.145 0.188 0.167 0.396 0.426 0.161 0.001 0.056 0.069 0.121 0.002
 [505] 0.192 0.057 0.045 0.005 0.175 0.115 0.062 0.101 0.079 0.058 0.309 0.343
 [517] 0.043 0.235 0.003 0.259 0.013 0.086 0.098 0.066 0.284 0.041 0.366 0.071
 [529] 0.281 0.130 0.132 0.029 0.002 0.289 0.353 0.028 0.183 0.249 0.106 0.301
 [541] 0.156 0.030 0.020 0.167 0.268 0.052 0.014 0.117 0.339 0.355 0.021 0.420
 [553] 0.007 0.220 0.089 0.205 0.245 0.042 0.189 0.261 0.132 0.282 0.150 0.245
 [565] 0.196 0.214 0.128 0.011 0.003 0.139 0.012 0.166 0.088 0.019 0.020 0.034
 [577] 0.005 0.152 0.055 0.074 0.262 0.044 0.032 0.095 0.244 0.190 0.127 0.025
 [589] 0.222 0.116 0.198 0.035 0.107 0.088 0.042 0.121 0.141 0.241 0.011 0.040
 [601] 0.073 0.304 0.056 0.088 0.076 0.058 0.059 0.056 0.023 0.034 0.196 0.457
 [613] 0.145 0.012 0.024 0.012 0.287 0.111 0.207 0.072 0.300 0.026 0.309 0.001
 [625] 0.214 0.014 0.289 0.391 0.163 0.120 0.406 0.028 0.018 0.245 0.145 0.134
 [637] 0.032 0.090 0.269 0.009 0.122 0.360 0.098 0.180 0.051 0.061 0.135 0.057
 [649] 0.085 0.262 0.102 0.012 0.209 0.053 0.033 0.029 0.114 0.017 0.072 0.116
 [661] 0.066 0.077 0.196 0.187 0.147 0.193 0.030 0.009 0.120 0.070 0.084 0.427
 [673] 0.201 0.285 0.073 0.255 0.021 0.020 0.171 0.026 0.080 0.287 0.254 0.189
 [685] 0.225 0.138 0.123 0.050 0.076 0.150 0.026 0.282 0.094 0.224 0.032 0.175
 [697] 0.013 0.026 0.231 0.133 0.171 0.017 0.220 0.030 0.022 0.049 0.331 0.426
 [709] 0.144 0.047 0.016 0.297 0.100 0.373 0.013 0.091 0.029 0.348 0.353 0.102
 [721] 0.003 0.249 0.157 0.004 0.272 0.003 0.004 0.070 0.060 0.306 0.247 0.155
 [733] 0.157 0.113 0.377 0.083 0.244 0.237 0.262 0.077 0.044 0.042 0.043 0.360
 [745] 0.056 0.086 0.122 0.015 0.357 0.324 0.418 0.075 0.088 0.241 0.419 0.318
 [757] 0.005 0.070 0.204 0.413 0.233 0.046 0.311 0.060 0.266 0.111 0.074 0.233
 [769] 0.146 0.385 0.434 0.227 0.055 0.029 0.247 0.116 0.329 0.058 0.254 0.179
 [781] 0.439 0.093 0.329 0.100 0.036 0.069 0.159 0.021 0.041 0.108 0.037 0.077
 [793] 0.071 0.205 0.212 0.431 0.181 0.066 0.348 0.097 0.152 0.320 0.006 0.007
 [805] 0.006 0.186 0.311 0.018 0.032 0.002 0.013 0.137 0.034 0.105 0.045 0.325
 [817] 0.154 0.129 0.071 0.168 0.221 0.134 0.151 0.282 0.412 0.316 0.123 0.190
 [829] 0.372 0.096 0.049 0.132 0.222 0.062 0.387 0.007 0.251 0.300 0.043 0.029
 [841] 0.086 0.016 0.184 0.075 0.051 0.143 0.187 0.214 0.376 0.127 0.010 0.203
 [853] 0.140 0.177 0.219 0.014 0.042 0.086 0.128 0.218 0.277 0.269 0.081 0.117
 [865] 0.029 0.033 0.142 0.037 0.257 0.397 0.074 0.185 0.110 0.160 0.041 0.371
 [877] 0.306 0.001 0.055 0.034 0.016 0.083 0.019 0.162 0.129 0.257 0.026 0.198
 [889] 0.187 0.095 0.198 0.002 0.091 0.076 0.031 0.134 0.022 0.019 0.210 0.010
 [901] 0.346 0.239 0.444 0.137 0.195 0.011 0.037 0.055 0.327 0.372 0.042 0.004
 [913] 0.216 0.105 0.108 0.091 0.110 0.147 0.025 0.126 0.041 0.020 0.113 0.126
 [925] 0.006 0.342 0.034 0.039 0.213 0.032 0.153 0.114 0.121 0.128 0.216 0.104
 [937] 0.124 0.137 0.051 0.002 0.013 0.325 0.073 0.133 0.173 0.252 0.217 0.256
 [949] 0.017 0.186 0.033 0.067 0.229 0.118 0.339 0.049 0.068 0.080 0.089 0.039
 [961] 0.107 0.151 0.178 0.044 0.104 0.055 0.037 0.412 0.368 0.034 0.106 0.004
 [973] 0.100 0.156 0.096 0.199 0.366 0.010 0.294 0.396 0.137 0.109 0.165 0.292
 [985] 0.007 0.175 0.027 0.106 0.282 0.328 0.093 0.038 0.273 0.120 0.053 0.233
 [997] 0.125 0.258 0.083 0.405

DepthProc documentation built on May 2, 2019, 6:22 p.m.