# Calculating Harmonic Mean

Harmonic mean is calculated by dividing the number of observations (n) by the sum of reciprocals of all observations.

Harmonic mean has some applications in finance. One application is to calculate the average purchase cost of shares purchased over time.

Let’s say that an investor purchased a stock worth $100 for two months. The share price at the time of each purchase was 5 and 7. What will be the average purchase price? We can calculate this as follows.

The number of stocks purchased in the two months are $100/5 = 20 and $100/7 = 14.286. Total number of shares purchased is 34.286 for a total cost of $200. Average purchase price will be = $200/34.286 = 5.833. This is in fact the harmonic mean.

We can use the harmonic mean formula to calculate this.

The relationship between Harmonic Mean, Arithmetic Mean, and Geometric Mean is as given below:

**Harmonic Mean < Geometric Mean < Arithmetic Mean**

- Descriptive Vs. Inferential Statistics
- Types of Measurement Scales
- Parameter, Sample Statistic, and Frequency Distribution
- Relative Frequencies and Cumulative Relative Frequencies
- Properties of a Data Set (Histogram / Frequency Polygon)
- Measures of Central Tendency
- Calculating Arithmetic Mean
- Calculating Weighted Average Mean
- Calculating Geometric Mean
- Calculating Harmonic Mean
- Calculating Median and Mode of a Data Set
- Quartiles, Quintiles, Deciles, and Percentiles
- Range and Mean Absolute Deviation
- Variance and Standard Deviation
- Chebyshev’s Inequality
- Coefficient of Variation
- Sharpe Ratio
- Skewness and Kurtosis
- Relative Locations of Mean, Median and Mode

# R Programming Bundle: 25% OFF

**R Programming - Data Science for Finance Bundle**for just $29 $39.