Code covered by the BSD License  

Highlights from
gmean

Be the first to rate this file! 4 Downloads (last 30 days) File Size: 2.39 KB File ID: #19469

gmean

by Antonio Trujillo-Ortiz

 

05 Apr 2008 (Updated 08 Apr 2008)

Generalized mean.

| Watch this File

File Information
Description

A generalized mean, also known as power mean, Holder mean or Kolmogorov-Negumo function of the mean, is an abstraction of the Pythagorean means included harmonic, geometric, and arithmetic mean.

It is defined as,

Mk = [1/n(x1^k + x2^k + ... + xn^k)]^1/k

where: k is indicator power for the desired mean (-1 = harmonic mean; 0 = geometric mean; 1 = arithmetic mean;2 = root mean square).

Although it is not possible to put k = 0 directly but, according to the L’Hopital’s theorem, the limit as k tends to zero exists,

Mk = lim k->0 [1/n(x1^k + x2^k + ... + xn^k)]^1/k = (x1x2 ... xn)^1/k

Input:
x - Input data vector
k - desired power (-1 = harmonic mean ;0 = geometric mean;1 = arithmetic mean;2 = root mean square)

Output:
y - Desired mean

MATLAB release MATLAB 7 (R14)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Please login to add a comment or rating.
Updates
07 Apr 2008

It was added an appropriate format to cite this file.

08 Apr 2008

Text was improved.

Tag Activity for this File
Tag Applied By Date/Time
statistics Antonio Trujillo-Ortiz 22 Oct 2008 09:56:33
probability Antonio Trujillo-Ortiz 22 Oct 2008 09:56:33
generalized mean Antonio Trujillo-Ortiz 22 Oct 2008 09:56:33
harmonic Antonio Trujillo-Ortiz 22 Oct 2008 09:56:33
root mean square Antonio Trujillo-Ortiz 22 Oct 2008 09:56:33
geometric Antonio Trujillo-Ortiz 22 Oct 2008 09:56:33
arithmetic Antonio Trujillo-Ortiz 22 Oct 2008 09:56:33
harmonic Neeraj Iyer 28 Apr 2011 01:42:38

Contact us at files@mathworks.com