Software to compute Integrated Depth for Partially Observed Functional Data and applications
It implements the proposed depth measures, functional boxplot, functional outliergram for partially observed functional data and reconstruction methods.
#install the package
# devtools::install_github("aefdz/fdaPOIFD")
install.packages("fdaPOIFD", repos = c('https://aefdz.r-universe.dev', 'https://cloud.r-project.org'))
#load the package
library(fdaPOIFD)
#plot the data sets
plot_interval <- plotPOFD(exampleData$PoFDintervals)
plot_common <- plotPOFD(exampleData$PoFDextremes)
plot_interval
## Warning: Removed 2914 rows containing missing values or values outside the scale range
## (`geom_line()`).
## Warning: Removed 9900 rows containing missing values or values outside the scale range
## (`geom_point()`).

plot_common
## Warning: Removed 7368 rows containing missing values or values outside the scale range
## (`geom_line()`).
## Warning: Removed 7368 rows containing missing values or values outside the scale range
## (`geom_point()`).

Example with partially observed common domain. Data is in a matrix form:
mbd <- POIFD(exampleData$PoFDintervals, type = "MBD")
(median <- which.max(mbd)) # deepest curve
## 45
## 45
Example without partially observed common domain. It implements an step to estimate the observation domain. Data is in a list form:
exampleData$PoFDintervals_list[[1]]
## $x
## [1] 0.000000000 0.005050505 0.010101010
##
## $y
## [1] 0.7814341 0.7939221 0.8063511
To compute the POIFD, we need to include the vector where the data should be evaluated:
mbd <- POIFD(exampleData$PoFDintervals_list, type = "MBD", t = seq(0, 1, length.out = 100))
(median <- which.max(mbd)) # deepest curve
## 44
## 44
fboxplot <- boxplotPOFD(exampleData$PoFDextremes_outliers, centralRegion = 0.5, fmag = 1.5, fdom = 1)
fboxplot$magnitude
## 102
## 102
fboxplot$domain
## 102
## 102
fboxplot$fboxplot
## Warning: Removed 27 rows containing missing values or values outside the scale range
## (`geom_line()`).
## Removed 27 rows containing missing values or values outside the scale range
## (`geom_line()`).

outliergram <- outliergramPOFD(exampleData$PoFDextremes_outliers)
outliergram$shape
## [1] 103 104
outliergram$outliergram

It implements a reconstruction method based on the partially observed functional depth and the algorithm proposed in Elías, A., Jiménez, R. and Shang, HL. (2022).
data <- exampleData$PoFDintervals
recons_data <- depthbasedreconstructionPOFD(data, id_recons = c(1:2))
par(mfrow = c(1,2))
matplot(data[,1:2], col = c("blue", "red"), type ="l", lty = 1, main = "POFD", ylab = "Y")
matplot(data[,1:2], col = c("blue", "red"), type ="l", lty = 1, main = "Reconstruction", ylab = "Y")
matplot(recons_data, col = c("blue", "red"), add = TRUE, type = "l", lty = 2, main = "Reconstruction", ylab = "Y")

par(mfrow = c(1,1))
Elías, A., Jiménez, R. and Shang, HL. (2022) On projection methods for functional time series forecasting, Journal of Multivariate Analysis, Volume 189, 2022.
Elías, A., Jiménez, R., Paganoni, A. M., & Sangalli, L. M. (2023). Integrated depths for partially observed functional data. Journal of Computational and Graphical Statistics, 32(2), 341-352.
Elías, A., Jiménez, R., & Shang, H. L. (2023). Depth-based reconstruction method for incomplete functional data. Computational Statistics, 38(3), 1507-1535.
Elías, A., Nagy, S. (2025). Statistical Properties of Partially Observed Integrated Funcional Depths. TEST, 34, 125-150.