stats_3d function

Computes mean and standard deviation