# Everything You Need To Know About Series MAD Method

## Achievements are always with respect to some metrics.

At the games room today, I met one of my friends from the sales team. He is normally a very good player of table tennis well but today he has lost all the games. Quiet evident that he is not in a good mood. Tried to find out what is it about.

Their team is closing the sales of this quarter and sending reports to the top management. This guy has executed a good number of sales orders. But his achievements are not getting to the slide that shows team highlights. When asked why he says, the manager is concerned to show because the system shows the standard deviation is very high on my sales track. The manager agrees the count of sales is very good from my end but not sure why the SD is in red!!

I thought there is something I can do to get the real achievements highlighted. We worked together for a few minutes to see the possibility.

## Let’s look into the data

Give me sales numbers for the last 12 weeks.

```series = pd.Series([390, 433, 434, 430, 431, 429, 432, 429, 432, 485,429,432])
series.plot.bar()```

Let’s check the Mean & SD of this distribution.

```print("Mean: "+ str(round(series.mean(),2)))
print("Standard Deviation: " +str(round(series.std(),2)))```
```Mean: 432.17
Standard Deviation: 20.47```

Oh! the standard deviation is very high. Probably this is the reason why your manager doesn’t want to present these sales as an achievement. Your bar plot looks more or less consistent but why does your standard deviation is showing high. Don’t worry, let’s check the mean absolute deviation.

Mean Absolute Deviation

```print("Mean: "+ str(round(series.mean(),2)))
print("Standard Deviation: " +str(round(series.std(),2)))
```Mean: 432.17
Standard Deviation: 20.47
Mean Absolute Deviation(MAD): 9.25```

See, the mean absolute deviation is very low. Our doubt was correct.

That’s interesting! What’s the difference?

## Standard Deviation vs Mean Absolute Deviation

How much are you deviating from mean each week?

`(series - series.mean()).plot.bar()`

Mean Absolute Deviation is the average of this absolute deviation. Except for 2 weeks, the first and the tenth week, the sales are consistent. So, the value of MAD is less.

Standard Deviation considers one more factor on top of that. The deviation of the points from the mean plus the deviation of the points from each other.

```pd.DataFrame({'Week':series.index,
'Sales':series}).plot.scatter(x = 'Week', y = 'Sales', s = 'Sales', c = 'blue');```