# Why Isn't This Outlier Score/Reconstruction Error Not Squared?

I was looking through a paper called "AI2 : Training a big data machine to defend", and saw this (http://people.csail.mit.edu/kalyan/AI2_Paper.pdf)

$score(X_{i}) = \sum_{j=1}^{p} (|X_{i} − R^{j}_{i}|) × ev(j)$

Where $ev(j)$ is the percentage of variance.

I was wondering, why isn't the the term $(|X_{i} − R^{j}_{i}|)$ squared like other reconstruction error functions, or at least the ones I saw?

I believe the term $\sum_{j=1}^{p} (|X_{i} − R^{j}_{i}|)$ is a mean absolute error and is used here because it is better than a mean square error because it is better for a time series and is more robust. If I am wrong, please correct me.

## 1 Answer

there is a good explaination squarred vs flat.

But from the simple view squarred error aims at variance while flat at median.
Different outliers comes from both versions, this is task dependent - the choice has been made by authors.

In fact yes, it is called roboust (somehow missused term), but it is not "better" for time series, just gives better estimator for outliers in presented method, which from given equation uses neither mean error nor mean square error - it uses custom made estimator with variance calculated on it's own.