Find shape and magnitude outliers using the Total Variation Depth and Modified Shape Similarity Index proposed in Huang and Sun (2019) tools:::Rd_expr_doi("10.1080/00401706.2019.1574241").
tvd_mss(
data,
emp_factor_mss = 1.5,
emp_factor_tvd = 1.5,
central_region_tvd = 0.5
)tvdmss(
dts,
emp_factor_mss = 1.5,
emp_factor_tvd = 1.5,
central_region_tvd = 0.5
)
Returns a list containing the following
outliers
the indices of the (shape and magnitude) outliers
shape_outliers
the indices of the shape outliers
magnitude_outliers
the indices of the magnitude outliers
tvd
the total variation depths of the observations of data
mss
the modified shape similarity index of the observations of data
The empirical factor of the classical boxplot used on the modified shape similarity index. Defaults to 1.5.
The empirical factor of the functional boxplot used on the TVD of observations. Defaults to 1.5.
A number between 0 and 1 indicating the central region probability of the functional boxplot used on the TVD of the observations. Defaults to 0.5. See also details.
A matrix or dataframe of size \(n\) observations/curves by \(p\) domain/evaluation points.
tvd_mss()
: Deprecated function. Use tvdmss
instead.
Oluwasegun Ojo
This method uses a combination of total variation depth (TVD) and modified shape similarity (MSS) index
defined in Huang and Sun (2019) tools:::Rd_expr_doi("10.1080/00401706.2019.1574241")
to find magnitude and shape outliers. The TVD and MSS of all the observations are
first computed and a classical boxplot is then applied on the MSS. Outliers detected
by the boxplot of MSS are flagged as shape outliers. The shape outliers are then removed
from the data and the TVD of the remaining observations are used in a functional boxplot
to detect magnitude outliers. The central region
of this functional boxplot (central_region_tvd
) is w.r.t. to the original number of curves. Thus if
8 shape outliers are found out of 100 curves, specifying central_region_tvd
= 0.5 will ensure that
50 observations are used as the central region in the functional boxplot on the remaining 92 observations.
Huang, H., & Sun, Y. (2019). A decomposition of total variation depth for understanding functional outliers. Technometrics, 61(4), 445-458.
msplot
for outlier detection using msplot.
dt6 <- simulation_model6()
res <- tvdmss(dt6$data)
res$outliers
Run the code above in your browser using DataLab