Arithmetic Mean
The arithmetic mean, commonly known as the average, is a very straightforward concept used in statistics to represent the central value of a data set. It's obtained by summing up all the values and then dividing by the number of values. In MATLAB, this can easily be calculated using the \texttt{mean} function.
For example, with a set of numbers like \(4, 3, 4, 5, 4, 3, 5\), the arithmetic mean is computed by adding all these numbers to get 28, and then dividing by 7, giving us an arithmetic mean of 4. It offers a quick snapshot of the 'typical' value in your data set and is particularly useful when dealing with data without extreme values.
RMS Average
The RMS average, or Root Mean Square average, adds a little complexity compared to the arithmetic mean. It calculates the square root of the mean of the squares of the numbers in the set. This type of average is particularly useful in fields such as electrical engineering and acoustics because it provides a measure of the magnitude of a varying quantity.
In MATLAB, the RMS average is not a built-in function but can be calculated by squaring each number, averaging the squares, and then taking the square root of that average. For instance, with the set \(4, 3, 4, 5, 4, 3, 5\), the RMS average is the square root of \(\frac{4^2 + 3^2 + 4^2 + 5^2 + 4^2 + 3^2 + 5^2}{7}\), which is approximately 4.22.
Geometric Mean
The geometric mean differs from the arithmetic mean by focusing on the product rather than the sum of the numbers. To calculate the geometric mean, multiply all the numbers in the set together and then take the nth root of the product, where 'n' is the number of values in the dataset.
In MATLAB, we can compute the geometric mean of a dataset using \texttt{geomean} function. For the set \(4, 3, 4, 5, 4, 3, 5\), we multiply all the numbers to get 36000, and then we compute the 7th root, yielding a geometrical mean of approximately 3.98. The geometric mean is especially meaningful in situations where we are comparing things with very different ranges or different units of measure.
Harmonic Mean
The harmonic mean is the least common type of average and is particularly useful when dealing with rates. It is calculated as the reciprocal of the arithmetic mean of the reciprocals of the data points. Essentially, you take the number of values in the dataset, divide it by the sum of the reciprocals of the values.
To compute it in MATLAB, we use the \texttt{harmmean} function. With numbers \(4, 3, 4, 5, 4, 3, 5\), the harmonic mean is \(\frac{7}{\frac{1}{4} + \frac{1}{3} + \frac{1}{4} + \frac{1}{5} + \frac{1}{4} + \frac{1}{3} + \frac{1}{5}}\), giving us approximately 3.76. The harmonic mean is less affected by extremely high or low values, which makes it more robust in certain cases than the arithmetic mean.