Can any HP calculators crunch a geometric mean for an easily editable list of numbers without requiring the entry of a separate program?
Geometric mean and HP calculators

11302006, 12:49 PM
11302006, 01:39 PM
I doubt that any HPs have a convenient "Geometric Mean" function. But you can get the desired result on the HP48, and presumably on the more recent HP49 and HP50, through a series of steps: 1. Enter your raw data as a "list". Store the list for future editing if desired. 2. Hit LOG or LN to transform all of the values in the list. Now you have a second, logtransformed list. 3. Disassemble the logtransformed "list" and reassemble it as an "array". Save the array as "SigmaDAT", which is the reserved name for statistics data. 4. Hit MEAN to calculate the mean of the logtransformed data in the "SigmaDAT" array. 5. Hit the appropriate antilog (10^X or e^X) for the geometric mean. Probably you could write simple programs to automate this process. There may be other ways to do it.
Edited: 30 Nov 2006, 2:12 p.m. after one or more responses were posted
11302006, 01:56 PM
The following HP48 program seems to work for me:
<< Enter and save your list of raw data (Step 1). Then put it on the stack, and run the program. It quickly executes Steps 2 to 5, and the result is the geometric mean. The only tricky part is converting the list to an array (Step 3).
Edited: 30 Nov 2006, 1:57 p.m.
12012006, 07:40 AM
Once you have the list of numbers, apply the pList function against the list and then get the n root to the function result. pList function  p is the greek pi character (alpha right shift P) 1. Put number in a list such as {13 22 17 19} 2. Apply pList function to your list. This will give you a multiplied sum  92378 3. Get the root of the pList sum where the root value is the number of elements in the list  that is the 4th root of 92378 giving 17.43 as the geometric mean (put 4 on stack and use keys alpha right shift R)
You can compare your calculator results here
Edited: 1 Dec 2006, 7:47 a.m.
12012006, 12:42 PM
That's more elegant than my approach. A few comments:  For Step 3, you could use the SIZE function to determine the number of elements in the list.  You are apparently not using an HP48, because I have different keys for the "Pi" in the PiLIST command and for the XROOT function.  The product generated by PiLIST could conceivably generate an overflow error if the list was very large, and/or contained very large values
Edited: 1 Dec 2006, 1:01 p.m.
12012006, 05:17 PM
How about using the statistics lists in the 27S/17B/17BII/17BII+/ etc. along with a small solver equation. This is a very easy list editor to use and the equation is fairly simple. Assuming the list is called GMEAN the equation would be something like: GMEAN: 0xL(X:1)+0xSIGMA(I:1:SIZES(GMEAN):1:L(X:G(X)xITEM(GMEAN:I)))+G(X)^INV(SIZES(GMEAN))=GMEAN To use this, just create a list in SUM and name it GMEAN. Edit it as needed and when you want to compute the geometric mean go into SOLVE, pick the 'GMEAN' equation and hit the GMEAN key. You could also use the cash flow lists and then you'd be able to use the number of occurrences as well with only a slightly more complicated solver equation. Katie
12012006, 06:15 PM
I'm using the 50g. Geometric mean is described in the 50g reference manual pg 815 but the result they show for the example is wrong (one of many errors in that book). The answer is 1.9307... not 1.0032..... Example reversed the root (took 720th root of 10 insteead of 10th root of 720). http://h20000.www2.hp.com/bizsupport/TechSupport/DocumentIndex.jsp?contentType=SupportManual&lang=en&cc=us&docIndexId=179111&taskId=101&prodTypeId=215348&prodSeriesId=3235173manual
12012006, 11:02 PM
Quote: "That's more elegant than my approach." Not really. The approach which uses logarithms delays the onset of the overflow problems which are inherent in this kind of calculation.
12022006, 10:00 AM
While using logs gives you much smaller numbers, getting an overflow with PiList is unlikely since overflow >= 10^500. Here's the program, assuming the list is on stack 1
<< > list where 'Pi' is the mathematical pi character.
Edited: 2 Dec 2006, 11:23 a.m. 
« Next Oldest  Next Newest »

Possibly Related Threads...  
Thread  Author  Replies  Views  Last Post  
Before I had HP calculators, I had Sharp calculators  hecube  7  977 
08262009, 06:57 AM Last Post: Mark Edmonds 

Geometric problem  Hal Bitton in Boise  2  438 
02112008, 11:50 AM Last Post: Hal Bitton in Boise 

Geometric mean and std. dev. on 12C or 12CP  mk  2  465 
12122006, 11:02 PM Last Post: Katie Wasserman 

geometric progression  Jim Kimes  18  1,589 
06252004, 08:39 AM Last Post: Jim Kimes 