Absolute value or the modulus of a real number x is the non-negative value of x without regard to its sign. For example absolute value of 7 is 7 and the absolute value of -7 is also 7.
Deviation is a measure of the difference between the observed value of a variable and some other value, often that variable’s mean.
The absolute deviation of an element of a data set is the absolute difference between that element and a given point. The absolute deviation of the observations X1, X2, X3, ….., Xn around a value A is defined as –
For discrete (ungrouped) data-
For continuous (ungrouped) data-
Absolute mean deviation:
The absolute mean deviation measures the spread and scatteredness of data around, preferably the median value, in terms of absolute deviation. The absolute deviation of observation X1, X2, X3, ……, Xn is minimum when measured around median i.e. A is the median of the data. Then, thus obtained absolute deviation is termed as the absolute mean deviation and is defined as:
For discrete (ungrouped) data –
For continuous (ungrouped) data –
- The data set having a higher value of absolute mean deviation (or absolute deviation) has more variability.
- The data set with a lower value of absolute mean deviation (or absolute deviation) is preferable.
–> If there are two data sets with absolute mean values AMD1 and AMD2, and AMD1>AMD2 then the data in AMD1 is said to have more variability than the data in AMD2.
Following are the number of candidates enrolled each day in last 20 days for the GeeksforGeeks -DS & Algo course –
75, 69, 56, 46, 47, 79, 92, 97, 89, 88, 36, 96, 105, 32, 116, 101, 79, 93, 91, 112
Code #1: Absolute deviation using numpy
Code #2: Absolute mean deviation using numpy
Code #3: Absolute mean deviation using pandas
- Python | Pandas Series.mad() to calculate Mean Absolute Deviation of a Series
- Compute the mean, standard deviation, and variance of a given NumPy array
- Create the Mean and Standard Deviation of the Data of a Pandas Series
- How to Plot Mean and Standard Deviation in Pandas?
- Calculate the average, variance and standard deviation in Python using NumPy
- Interquartile Range and Quartile Deviation using NumPy and SciPy
- numpy.mean() in Python
- Python | Find Mean of a List of Numpy Array
- Python | Numpy matrix.mean()
- Numpy recarray.mean() function | Python
- Numpy MaskedArray.mean() function | Python
- Calculate the mean across dimension in a 2D NumPy array
- Python | Standard deviation of list
- numpy.absolute() in Python
- Pandas - GroupBy One Column and Get Mean, Min, and Max values
- Python | Numpy numpy.resize()
- Python | Numpy numpy.transpose()
- Python | Numpy numpy.ndarray.__lt__()
- Python | Numpy numpy.ndarray.__gt__()
- Python | Numpy numpy.ndarray.__le__()
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.