msplot | R Documentation |
This function finds outliers in univariate and multivariate functional data using the MS-Plot
method described in Dai and Genton (2018) \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1080/10618600.2018.1473781")}.
Indices of observations flagged as outliers are returned. In addition, the
scatter plot of VO
against MO
(||MO||) can be requested for univariate
(multivariate) functional data.
msplot(
dts,
data_depth = c("random_projections"),
n_projections = 200,
seed = NULL,
return_mvdir = TRUE,
plot = TRUE,
plot_title = "Magnitude Shape Plot",
title_cex = 1.5,
show_legend = T,
ylabel = "VO",
xlabel
)
dts |
A matrix/data frame for univariate functional data (of size |
data_depth |
The depth used in the computation of the directional outlyingness of
|
n_projections |
The number of random directions to generate for computing the random projection depth. By default 200 directions are generated. |
seed |
An integer indicating the seed to set when generating random directions for computing the random projection depth. NULL by default in which case no seed is set. |
return_mvdir |
A logical value indicating whether to return the mean and variation of directional
outlyingness ( |
plot |
A logical indicating whether to make the msplot of |
plot_title |
The title of the plot. Set to "Magnitude Shape Plot" by default. Ignored if
|
title_cex |
Numerical value indicating the size of the plot title relative to the device default.
Set to 1.5 by default. Ignored if |
show_legend |
A logical indicating whether to add legend to plot if |
ylabel |
The label of the y-axis. Set to "VO" by default. |
xlabel |
The label of the x-axis if |
MS-Plot finds outliers by computing
the mean and variation of directional outlyingness (MO
and VO
) described
in Dai and Genton (2019) \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1016/j.csda.2018.03.017")}.
A multivariate data whose columns are the computed MO
and VO
is then constructed and
the robust mahalanobis distance(s) of the rows of this matrix are computed
(using the minimum covariate determinant estimate of the location and scatter). The tail
of the distribution of these distances is approximated using the F
distribution
according to Hardin and Rocke (2005) \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1198/106186005X77685")} to get the cutoff.
The projection depth is always used for computing the directional outlyingness
(as suggested by Dai and Genton (2019) \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1016/j.csda.2018.03.017")}).
Returns a list containing:
outliers_index |
an integer vector containing the indices of the outliers. |
median_curve |
the index of the median function (which is the
function with the smallest robust mahalanobis distance computed from the matrix whose
columns are made up of |
mean_outlyingness |
if |
var_outlyingness |
if |
Oluwasegun Taiwo Ojo.
Dai, W., and Genton, M. G. (2018). Multivariate functional data visualization and outlier detection. Journal of Computational and Graphical Statistics, 27(4), 923-934.
Dai, W., and Genton, M. G. (2019). Directional outlyingness for multivariate functional data. Computational Statistics & Data Analysis, 131, 50-65.
Hardin, J., and Rocke, D. M. (2005). The distribution of robust distances. Journal of Computational and Graphical Statistics, 14(4), 928-946.
dir_out
for directional outlyingness and projection_depth
for multivariate projection depth.
# Univariate magnitude model in Dai and Genton (2018).
dt1 <- simulation_model1()
msplot_object <- msplot(dts = dt1$data)
msplot_object$outliers_index
msplot_object$mean_outlyingness
msplot_object$var_outlyingness
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.