Title: | Partially Observed Integrated Functional Depth |
---|---|
Description: | Applications to visualization, outlier detection and classification. Software companion for Elías, Antonio, Jiménez, Raúl, Paganoni, Anna M. and Sangalli, Laura M., (2022), "Integrated Depth for Partially Observed Functional Data". Journal of Computational and Graphical Statistics. \url{https://doi.org/10.1080/10618600.2022.2070171}. |
Authors: | Antonio Elías [aut, cre], Raúl Jiménez [ctb], Anna M. Paganoni [ctb], Laura M. Sangalli [ctb] |
Maintainer: | Antonio Elías <[email protected]> |
License: | GPL-3 |
Version: | 1.0.2 |
Built: | 2024-11-04 06:20:32 UTC |
Source: | https://github.com/aefdz/fdapoifd |
Plots the Functional Boxplot for PoFD and returns the magnitude and domain outliers.
Magnitude outliers in blue, a dotted red indicates that the outlier situation occurs
in a region with less than fdom
proportion of the central region.
boxplotPOFD(data, centralRegion = 0.5, fmag = 1.5, fdom = 0)
boxplotPOFD(data, centralRegion = 0.5, fmag = 1.5, fdom = 0)
data |
matrix p by n, being n the number of functions and p the number of grid points. |
centralRegion |
number between 0 and 1 determining the proportion of the deepest functions that builds the central region. |
fmag |
factor to enhance the functional central region and determine the functional whiskers. Default is equal to 1.5. The whiskers provide the rule to unmask magnitude outliers. |
fdom |
factor that provides the maximum proportion of observed functions in the central region to consider a magnitude outlier as a domain outlier also. A value equals to 0 means that domain outliers are those functions that are observed on the domain where any of the functions building the central region are observed. A value equals to 1 determine as domain outlier any magnitude outlier out of the region where the central region is completely observed. |
a list with the functional boxplot for PoDF the magnitude outliers and the domain outliers.
Sun, Y. and Genton, M. G. (2011). Functional boxplots. Journal of Computational & Graphical Statistics, 20(2):316–334.
data(exampleData) boxplotPOFD(exampleData$PoFDextremes_outliers, centralRegion = 0.5, fmag = 1.5, fdom = 0)
data(exampleData) boxplotPOFD(exampleData$PoFDextremes_outliers, centralRegion = 0.5, fmag = 1.5, fdom = 0)
Generates samples of functions observed in a common domain in the center part of the domain. See Elías et al (2020).
commondomainPOFD(data, observability = NULL, pIncomplete = NULL)
commondomainPOFD(data, observability = NULL, pIncomplete = NULL)
data |
functional data completely observed. pxn matrix being n the number of curves and p the number og evaluation points. |
observability |
mean observed proportion of the domain where each function is observed. |
pIncomplete |
number between 0 and 1 related to the proportion of curves that suffers partially observability. The default is 1 meaning that all the sample curves are partially observed. |
a list containing two elements 1) a functional sample and 2) the same sample of functions but partially observed following one of the schemes described in the argument type.
Elías, Antonio, Jiménez, Raúl, Paganoni, Anna M. and Sangalli, Laura M. (2020). Integrated Depths for Partially Observed Functional Data.
data <- sapply(1:100, function(x) runif(1)*sin(seq(0, 2*pi, length.out = 200)) + runif(1)*cos(seq(0, 2*pi, length.out = 200))) data_pofd <- commondomainPOFD(data, observability = 0.5, pIncomplete = 1)
data <- sapply(1:100, function(x) runif(1)*sin(seq(0, 2*pi, length.out = 200)) + runif(1)*cos(seq(0, 2*pi, length.out = 200))) data_pofd <- commondomainPOFD(data, observability = 0.5, pIncomplete = 1)
An illustrative Functional Gaussian processes with different partially observed patterns with outliers and without outliers.
exampleData
exampleData
A list with three data sets (functions by columns):
Partially observed functional data in intervals
Partially Observed functional data with missing intervals at the extremes
Same as above but including two magnitude and shape outliers
Elías, Antonio, Jiménez, Raúl, Paganoni, Anna M. and Sangalli, Laura M. (2020). Integrated Depths for Partially Observed Functional Data.
data(exampleData) plotPOFD(exampleData$PoFDintervals)
data(exampleData) plotPOFD(exampleData$PoFDintervals)
Generates samples of functions observed in different intervals. See Elías et al (2020).
intervalPOFD(data, observability = NULL, ninterval = NULL, pIncomplete = NULL)
intervalPOFD(data, observability = NULL, ninterval = NULL, pIncomplete = NULL)
data |
functional data completely observed. pxn matrix being n the number of curves and p the number og evaluation points. |
observability |
mean observed proportion of the domain where each function is observed. |
ninterval |
if type = "interval", n_interval is an integer with the number of observed intervals 1, 2, 3... Large values of this parameter requires a large parameter p to guarantee the observability level. |
pIncomplete |
number between 0 and 1 related to the proportion of curves that suffers partially observability. The default is 1 meaning that all the sample curves are partially observed. |
a list containing two elements 1) a functional sample and 2) the same sample of functions but partially observed following one of the schemes described in the argument type.
Elías, Antonio, Jiménez, Raúl, Paganoni, Anna M. and Sangalli, Laura M. (2020). Integrated Depths for Partially Observed Functional Data.
data <- sapply(1:100, function(x) runif(1)*sin(seq(0, 2*pi, length.out = 200)) + runif(1)*cos(seq(0, 2*pi, length.out = 200))) data_pofd <- intervalPOFD(data, observability = 0.5, ninterval = 2, pIncomplete = 1)
data <- sapply(1:100, function(x) runif(1)*sin(seq(0, 2*pi, length.out = 200)) + runif(1)*cos(seq(0, 2*pi, length.out = 200))) data_pofd <- intervalPOFD(data, observability = 0.5, ninterval = 2, pIncomplete = 1)
Plots the Outliergram for PoFD and returns the shape outliers.
outliergramPOFD(data, fshape = 1.5, p1 = 1, p2 = 0)
outliergramPOFD(data, fshape = 1.5, p1 = 1, p2 = 0)
data |
matrix p by n, being n the number of functions and p the number of grid points. |
fshape |
inflation of the outliergram that determine the shape outlier rule. |
p1 |
parameter of the outliergram for resampling method. Default = 1. |
p2 |
parameter of the outliergram for resampling method. Default = 0. |
a list with the functional outliergram for PoDF and the shape outliers.
Arribas-Gil, A. and Romo, J. (2014). Shape outlier detection and visualization for functional data: the outliergram.Biostatistics, 15(4):603–619.
data(exampleData) outliergramPOFD(exampleData$PoFDextremes_outliers, fshape = 1.5, p1 = 1, p2 = 0)
data(exampleData) outliergramPOFD(exampleData$PoFDextremes_outliers, fshape = 1.5, p1 = 1, p2 = 0)
Plot the sample of partially observed curves and the proportion of observed functions.
plotPOFD(data)
plotPOFD(data)
data |
matrix p by n, being n the number of functions and p the number of grid points. |
Plot of the partially observed functional data and the proportion of observed functions at each time point.
data(exampleData) plotPOFD(exampleData$PoFDextremes)
data(exampleData) plotPOFD(exampleData$PoFDextremes)
Compute the depth measures of a partially observed functional data set evaluated in a common grid.
POIFD(data, type = c("MBD", "FMD", "MHRD"), phi)
POIFD(data, type = c("MBD", "FMD", "MHRD"), phi)
data |
matrix p by n, being n the number of functions and p the number of grid points. Rownames are the dense grid x and colnames the identifier of each functional data. |
type |
chosen depth measure. Fraiman and Muniz depth ( |
phi |
phi function of weights for the POIFD. The default value is as in the paper, i.e. the proportion of observed functions at each time point. |
Ordered vector of depths from the deepest to outward. The names are the functions names (if provided) or the column position.
data(exampleData) data <- exampleData$PoFDintervals poifd <- POIFD(data, type = c("MBD"))
data(exampleData) data <- exampleData$PoFDintervals poifd <- POIFD(data, type = c("MBD"))
Generates samples of sparse functions. See Elías et al (2020).
sparsePOFD(data, observability = NULL, pIncomplete = NULL)
sparsePOFD(data, observability = NULL, pIncomplete = NULL)
data |
functional data completely observed. pxn matrix being n the number of curves and p the number og evaluation points. |
observability |
observed proportion of the domain where each function is observed. |
pIncomplete |
number between 0 and 1 related to the proportion of curves that suffers partially observability. The default is 1 meaning that all the sample curves are partially observed. |
a list containing two elements 1) a functional sample and 2) the same sample of functions but partially observed following one of the schemes described in the argument type.
Elías, Antonio, Jiménez, Raúl, Paganoni, Anna M. and Sangalli, Laura M. (2020). Integrated Depths for Partially Observed Functional Data.
data <- sapply(1:100, function(x) runif(1)*sin(seq(0, 2*pi, length.out = 200)) + runif(1)*cos(seq(0, 2*pi, length.out = 200))) data_pofd <- sparsePOFD(data, observability = 0.5, pIncomplete = 1)
data <- sapply(1:100, function(x) runif(1)*sin(seq(0, 2*pi, length.out = 200)) + runif(1)*cos(seq(0, 2*pi, length.out = 200))) data_pofd <- sparsePOFD(data, observability = 0.5, pIncomplete = 1)