Calculates the geometric mean of positive numbers — useful for averaging rates, ratios, and percentages. Access via MCP in Cursor or Windsurf for reliable statistical calculations, or call GET /v1/stats/geometric-mean directly. For dataset [2, 8, 32], returns 8.0. Unlike arithmetic mean, geometric mean prevents outliers from skewing growth rate calculations.
curl "https://tinyfn.io/v1/stats/geometric-mean" \
-H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/stats/geometric-mean', {
headers: { 'X-API-Key': 'YOUR_API_KEY' }
});
const data = await response.json();
console.log(data);
import requests
response = requests.get('https://tinyfn.io/v1/stats/geometric-mean',
headers={'X-API-Key': 'YOUR_API_KEY'})
data = response.json()
print(data)
Connect your AI agent (Claude, Cursor, Windsurf, etc.) to TinyFn's statistics tools:
{
"mcpServers": {
"tinyfn-stats": {
"url": "https://tinyfn.io/mcp/stats",
"headers": {
"X-API-Key": "YOUR_API_KEY"
}
}
}
}
Geometric mean multiplies all values and takes the nth root, ideal for averaging growth rates, financial returns, or any multiplicative data. Use it when values represent ratios or when you need the central tendency of exponential growth.
Pass your array of positive numbers to the geometric-mean tool. The MCP integration handles the calculation deterministically, preventing AI hallucination of statistical formulas.
Geometric mean is undefined for zero or negative values since it involves nth roots of products. The tool will return an error — filter your data to positive numbers first.
Arithmetic mean adds values and divides by count; geometric mean multiplies values and takes the nth root. Geometric mean is always ≤ arithmetic mean and better represents central tendency for multiplicative processes.
Yes, geometric mean is perfect for growth rates. Convert percentages to multipliers (110% = 1.1), calculate geometric mean, then subtract 1 to get the average growth rate.
Get your free API key and start using Geometric Mean in seconds.
Get Free API Key