fdaPOIFD

Partially Observed Integrated Functional Depth


License
GPL-3.0

Documentation

fdaPOIFD

License

Overview

Software companion for the paper “Integrated Depth for Partially Observed Functional Data” (Elías, Antonio, Jiménez, Raúl, Paganoni, Anna M. and Sangalli, Laura M., 2020).

It implements the proposed depth measures, functional boxplot and functional outliergram for partially observed functional data.

Installation

#install the package
devtools::install_github("aefdz/fdaPOIFD")

#load the package
library(POIFD)

Test usage

#Generate data
sparse_gaussian <- gaussian_PoFD(n=10, p=200, type="sparse", observability=0.5)
common_gaussian <- gaussian_PoFD(n=10, p=200, type="common", observability=0.5)
interval_gaussian <- gaussian_PoFD(n=10, p=200, type="interval", ninterval=3, observability=0.5)

#plot the data sets
plot_sparse <- plot_PoFD(sparse_gaussian$pofd)
plot_interval <- plot_PoFD(interval_gaussian$pofd)
plot_common <- plot_PoFD(common_gaussian$pofd)

plot_sparse 
## Warning: Removed 19 row(s) containing missing values (geom_path).

plot_interval
## Warning: Removed 468 row(s) containing missing values (geom_path).

plot_common
## Warning: Removed 786 row(s) containing missing values (geom_path).

Computing depths

mbd <- POIFD(common_gaussian$pofd, type = "MBD")

(median <- mbd[1])
##         9 
## 0.4299926
  • Fraiman, R. and Muniz, G. (2001). Trimmed means for functional data. Test, 10(2):419–440.
  • López-Pintado, S. and Romo, J. (2009). On the concept of depth for functional data. Journal of the American Statistical Association, 104(486):718–734.
  • López-Pintado, S. and Romo, J. (2011). A half-region depth for functional data. Computational Statistics and Data Analysis, 55(4):1679–1695.

Functional Boxplot and magnitude outliers

data(exampleData)

fboxplot <- boxplot_PoFD(exampleData$PoFDextremes_outliers, centralRegion = 0.5, fmag = 1.5, fdom = 1)

fboxplot$magnitude
## 101 102 
## 101 102
fboxplot$domain
## 101 102 
## 101 102
fboxplot$fboxplot
## Warning: Removed 119 row(s) containing missing values (geom_path).

## Warning: Removed 27 row(s) containing missing values (geom_path).

## Warning: Removed 27 row(s) containing missing values (geom_path).

  • Sun, Y. and Genton, M. G. (2011). Functional boxplots. Journal of Computational and Graphical Statistics, 20(2):316–334.

Functional Outliergram and Shape Outliers

outliergram <- outliergram_PoFD(exampleData$PoFDextremes_outliers)

outliergram$shape
## [1] 103 104
outliergram$outliergram
## Warning: Removed 22 row(s) containing missing values (geom_path).

  • Arribas-Gil, A. and Romo, J. (2014). Shape outlier detection and visualization for functional data: the outliergram. Biostatistics, 15(4):603–619.

References

Elías, Antonio, Jiménez, Raúl, Paganoni, Anna M. and Sangalli, Laura M. (2020). Integrated Depths for Partially Observed Functional Data. (submitted)