mfd {mrfDepth} | R Documentation |
Multivariate functional depth for functional data
Description
Computes the multivariate functional depth for multivariate functional data.
Usage
mfd(x, z = NULL, type = "hdepth", alpha = 0, time = NULL, diagnostic = FALSE,
depthOptions = NULL)
Arguments
x |
A three-dimensional |
z |
An optional three-dimensional |
type |
The depth used in the computations.
One of the following options: |
alpha |
Specifies the weights at every cross-section.
When |
time |
If the measurements are not equidistant,
a sorted numeric vector containing a set of time points. |
diagnostic |
If set to |
depthOptions |
A list of options to pass to the function
computing the cross-sectional depths. |
Details
The multivariate functional depth of a multivariate curve with respect to a
given set of multivariate curves is defined as the weighted average of its
multivariate depth at each time point (Claeskens et al., 2014).
The MFD can be computed in all dimensions p
using halfspace depth,
projection depth, skewness-adjusted projection depth and directional projection depth.
For p<=2
also simplicial depth is available.
When the data array z
is specified, the MFD depth and diagnostic
information for the data array x
is also returned whenever the underlying
depth routine allows it. For more information see the specific depth routines
listed in the section "See Also".
For the weight vector, three options are available: uniform weights,
user-defined weights or weights proportional to the volume of the
\alpha
-depth contour at each time point.
The \alpha
-depth contours are computed using the depthContour
function.
In some situations, additional diagnostics are available to flag outlying time
points, as described in Hubert et al. (2012). At each time point, observations
from the data array x
are marked if they are flagged as outliers.
When using any of the projection depth measures, this flag is automatically
returned by the corresponding functions. When using halfspace depth,
the diagnostic is only available for bivariate curves. The observations
from the data array x
are marked if they are flagged as outliers by the
bagplot, or similarly if their bagdistance
is larger than 3 at that time
point. This can be seen as a measure of local outlyingness. The option is not
available for simplicial depth.
A heatmap of the cross-sectional depth values can be drawn by setting diagnostic
to TRUE and passing the results to fHeatmap
.
It is possible that at certain time points a part of the algorithm can not be executed due to e.g. exact fits. In that case the weight of that particular time point is set to zero. A warning is issued at the end of the algorithm to signal these time points. Furthermore the output contains an extra argument giving the indices of the time points where problems occured.
Value
A list with the following components:
MFDdepthX |
Vector of length |
MFDdepthZ |
Vector of length |
weights |
Vector of weights according to the input parameter
|
crossDepthsX |
An |
crossDepthsZ |
An |
locOutlX |
An |
locOutlZ |
An |
IndFlagExactFit |
Vector containing the indices of the time points for which an exact fit is detected. |
IndFlagBag |
Vector containing the indices of the time points for which the bagplot could not be computed. |
IndFlagIso |
Vector containing the indices of the time
points for which the cross-sectional |
IndFlagAlpha |
Vector containing the indices of the
time points for which the volume of the
cross-sectional |
Author(s)
P. Segaert and M. Hubert
References
Claeskens G., Hubert M., Slaets L., Vakili K. (2014). Multivariate functional halfspace depth. Journal of the American Statistical Association, 109, 411–423.
Hubert M., Claeskens G., De Ketelaere B., Vakili K. (2012). A new depth-based approach for detecting outlying curves. In Proceedings of COMPSTAT 2012, edited by A. Colubi, K. Fokianos, G. Gonzalez-Rodriguez, E.J. Kontoghiorghes, 329–340.
See Also
depthContour
, hdepth
, projdepth
,
sprojdepth
, dprojdepth
, sdepth
,
fHeatmap
Examples
data(octane)
Result <- mfd(x = octane, alpha = 0.125, diagnostic = TRUE)
Plot <- fHeatmap(rowValues = Result$MFDdepthZ,
cellValues = Result$crossdepthZ,
type = "depth",
legend.title = "HD")
Plot