DepthProc project consist of a set of statistical procedures based on so called statistical depth functions. The project involves free available R package and its description.

Versions

CRAN release version

CRAN version Downloads Build Status AppVeyor Build Status Coverage Status

Installation

DepthProc is avaiable on CRAN:

You can also install it from GitHub with devtools package:

library(devtools)
install_github("zzawadz/DepthProc")

Main features:

Speed and multithreading

Most of the code is written in C++ for additional efficiency. We also use OpenMP to speedup computations with multithreading:

##    user  system elapsed 
##   0.359   0.000   0.115
##    user  system elapsed 
##   0.215   0.000   0.216
# Two threads - 2 times slower:
system.time(depth(x, x, method = "LP", threads = 2))
##    user  system elapsed 
##   0.258   0.000   0.136

Available depth functions

Basic plots

Contour plot

library(mvtnorm)
y <- rmvt(n = 200, sigma = diag(2), df = 4, delta = c(3, 5))
depthContour(y, points = TRUE, graph_params = list(lwd = 2))

Perspective plot

depthPersp(y, depth_params = list(method = "Mahalanobis"))

Functional depths:

There are two functional depths implemented - modified band depth (MBD), and Frainman-Muniz depth (FM):

x <- matrix(rnorm(60), nc = 20)
fncDepth(x, method = "MBD")
fncDepth(x, method = "FM", dep1d = "Mahalanobis")
## Warning in dep1d_params$u <- u[, i]: Coercing LHS to a list

Functional BoxPlot

x <- matrix(rnorm(2000), ncol = 100)
fncBoxPlot(x, bands = c(0, 0.5, 1), method = "FM")