How can I do standard deviation in Ruby?

后端 未结 9 1443
一个人的身影
一个人的身影 2021-01-30 15:45

I have several records with a given attribute, and I want to find the standard deviation.

How do I do that?

9条回答
  •  抹茶落季
    2021-01-30 16:41

    In case people are using postgres ... it provides aggregate functions for stddev_pop and stddev_samp - postgresql aggregate functions

    stddev (equiv of stddev_samp) available since at least postgres 7.1, since 8.2 both samp and pop are provided.

提交回复
热议问题