예, mvBACON은 거리를 기준으로 한 이상 값 식별을위한 것입니다. 기본값은 Mahalanobis 거리입니다. 다음 코드는 mvcACON을 사용하여 특이점을 식별하는 방법에 대한 간단한 예제 인 mtcars 하위 데이터 집합을 보여줍니다.
# Use mtcars (sub)dataset and plot it
data <- mtcars %>% select(mpg, disp)
plot(data, main = "mtcars")
# Add some outliers and plot again
data <- rbind(data,
data.frame(mpg = c(1, 80), disp = c(800, 1000)))
plot(data, main = "mtcars")
# Use mvBacon to calculate the distances and get the ouliers
library(robustX)
distances <- mvBACON(data)
# Plot it again...
plot(data, main = "mtcars")
# ...with highlighting the outliers
points(data[!distances$subset, ], col = "red", pch = 19)
# Some fine tuning, since lot of outliers seem to be still good for regression
distances <- mvBACON(data, alpha = 0.6)
plot(data, main = "mtcars")
points(data[!distances$subset, ], col = "red", pch = 19)