# HarmonicMean HarmonicMean[data]

gives the harmonic mean of the values in data.

# Details • For vector data , the harmonic mean is given by .
• HarmonicMean[{{x1,y1},{x2,y2},}] gives {HarmonicMean[{x1,x2,}],HarmonicMean[{y1,y2,}]}. »
• HarmonicMean handles both numerical and symbolic data.
• The data can have the following additional forms and interpretations:
•  SparseArray as an array, equivalent to Normal[data] » QuantityArray quantities as an array » WeightedData weighted mean, based on the underlying EmpiricalDistribution » EventData based on the underlying SurvivalDistribution » TimeSeries, TemporalData, … vector or array of values (the time stamps ignored) » Image,Image3D RGB channel's values or grayscale intensity value » Audio amplitude values of all channels »

# Examples

open allclose all

## Basic Examples(2)

Harmonic mean of symbolic values:

Harmonic mean of columns of a matrix:

## Scope(12)

### Basic Uses(6)

Exact input yields exact output:

Approximate input yields approximate output:

Find the harmonic mean of WeightedData:

Find the harmonic mean of EventData:

Find the harmonic mean of a TimeSeries:

The harmonic mean depends only on the values:

Compute a weighted harmonic mean:

Find the harmonic mean of data involving quantities:

### Array Data(4)

HarmonicMean for a 2D matrix gives columnwise means:

Works with large arrays:

SparseArray data can be used just like dense arrays:

Find the harmonic mean of a QuantityArray:

### Image and Audio Data(2)

Channelwise harmonic mean value of an RGB image:

Harmonic mean intensity value of a grayscale image:

On audio objects, HarmonicMean works channelwise:

## Applications(1)

Find the harmonic mean for the heights of children in a class:

## Properties & Relations(5)

HarmonicMean is the inverse of Mean of the inverse of the data:

HarmonicMean is logarithmically related to GeometricMean for positive values:

For positive data , HarmonicMean[d]GeometricMean[d]Mean[d]:

Prove the inequality symbolically:

HarmonicMean[Range[n]] is inversely related to :

The harmonic mean of the shifted data is larger than the shifted harmonic mean of the original data (assuming the shift is a positive number):