bash: statistical properties

Hi

A bash script, after some operations, return with an array.
My goal is to calculate some statistical properties (hopefully still in bash) of that array, (like mean, variance, max_value and min_value).
For the max, mean and the min it seems work, but for the variance the notation is really 'heavy' and i always get some errors.
Do you know any way to do that using bash?
Thanks

D.

I'd use awk.

You can find scripts for mean, median, mode and standard deviation in my book, Shell Scripting Recipes: A Problem-Solution Approach.