Merge branch 'add-kurtosis' of https://github.com/CartoDB/cartodb-postgresql into add-kurtosis

This commit is contained in:
Andy Eschbacher 2015-09-03 22:44:06 -04:00
commit b5a9fb9fcf
3 changed files with 8 additions and 3 deletions

View File

@ -1 +1 @@
scripts-available/CDB_Stats.sql ../scripts-available/CDB_Stats.sql

View File

@ -1,5 +1,6 @@
-- continuous uniform distribution has kurtosis = -6/5, skewness = 0.0 -- continuous uniform distribution has kurtosis = -6/5, skewness = 0.0
-- http://mathworld.wolfram.com/UniformDistribution.html -- http://mathworld.wolfram.com/UniformDistribution.html
set client_min_messages to ERROR;
With dist As ( With dist As (
SELECT random()::numeric As val SELECT random()::numeric As val
@ -10,4 +11,6 @@ SELECT
-- does random dist values match within 1% of known values -- does random dist values match within 1% of known values
abs(CDB_Kurtosis(array_agg(val)) + 1.20) < 1e-2 As kurtosis, abs(CDB_Kurtosis(array_agg(val)) + 1.20) < 1e-2 As kurtosis,
abs(CDB_Skewness(array_agg(val)) - 0) < 1e-2 As skewness abs(CDB_Skewness(array_agg(val)) - 0) < 1e-2 As skewness
FROM dist FROM dist;
set client_min_messages to NOTICE;

View File

@ -1 +1,3 @@
true|true SET
t|t
SET