//
//Anomaly detection by mahalanobis distance. 
//
//(Caution) 
//This command outputs mahalanobis distans as mahara.


//Syntax 
mahadist variables

//Example 1
clear;
get data2d.csv@;

//anomaly detection by mahalanobis distance
mahadist dmy_1-2;
get freq@ana;

//output shows
plot scat dmy_1-2 mahara;

//descending by mahalanobis distance
sort -mahara;
put maha;

//plot shows upper 50 points as anomaly points
if(# < 50) outrec;
plot scat dmy_1-2;