Keywords - Function groups - @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Library: stats
See also: median

Macro: simdep
Description: Computes the simplicial depth estimate of location

Usage: {med,depths} = simdep(x{, mem})
Input:
x n x p matrix (n observations of dimension p)
mem optional parameter that affects the amount of memory used by the routine; the values belongs to interval (0,1), where 0 represents the minimal memory requirements and the lowest speed of computation, and 1 the maximal memory requirements and highest speed. Default value is 1. The higher is the dimension of observations (p), the bigger is the effect of the maximal memory setting (mem = 1).
Output:
med p x 1 vector containing the estimate of location
depth n x 1 vector containing for every observation the number of simpleces covering it

Example:
library("stats")
; 
; simulate data
;
randomize(101)
x = uniform(100)
;
; estimate the location by simdep
;
{med,d} = simdep(x)
med
;
; estimate the location by median
;
median(x)
Result:
There are two results confirming that the simplicial depth 
estimator is equivalent to median for one dimensional data:
Contents of med
[1,]  0.48251 
Contents of med
[1,]  0.48251 
Example:
library("stats")
library("xplore")
; 
; simulate data
;
randomize(10)
x = uniform(30,2)
;
; estimate the location by simdep
;
{med,dep} = simdep(x)
med
;
; draw a depth graph and median
;
d = createdisplay(1,1)
dat = x
col = round(5*dep/max(dep))
setmaskp(dat, col, 3, 8)
median = med'
setmaskp(median,4,12,15)    ; median is red big star
show(d, 1, 1, dat, median)
setgopt(d, 1, 1, "title", "Simplicial depth")
Result:
There are two types of output. First, in the output window, the
following estimate appears:
Contents of med
[1,]  0.53705
[2,]  0.33484
Second, there is also a graph showing the estimate as a big read
star and all data points as circles of different colors. The color
is given to every point according to its depth, i.e., the number of
simpleces that covers it. So, points with the lowest depths are
green, points with higher depths are blue, and so on.

Library: stats
See also: median

Keywords - Function groups - @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Author: Pavel Cizek, 2000-05-04
(C) MD*TECH Method and Data Technologies, 17.8.2000