From dc150e693697b276e8a12ec8b0a05dac00b9ca98 Mon Sep 17 00:00:00 2001 From: Andy Eschbacher Date: Wed, 21 Sep 2016 12:55:58 -0400 Subject: [PATCH] add test for moran global --- src/pg/test/expected/02_moran_test.out | 6 ++++++ src/pg/test/sql/02_moran_test.sql | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/src/pg/test/expected/02_moran_test.out b/src/pg/test/expected/02_moran_test.out index 3ba5bfd..7897622 100644 --- a/src/pg/test/expected/02_moran_test.out +++ b/src/pg/test/expected/02_moran_test.out @@ -5,6 +5,12 @@ SET client_min_messages TO WARNING; \set ECHO none _cdb_random_seeds +(1 row) +moran|significance +0.3399|-0.0196 +(1 row) +_cdb_random_seeds + (1 row) code|quads 01|HH diff --git a/src/pg/test/sql/02_moran_test.sql b/src/pg/test/sql/02_moran_test.sql index 5545a4a..d2cfaef 100644 --- a/src/pg/test/sql/02_moran_test.sql +++ b/src/pg/test/sql/02_moran_test.sql @@ -6,6 +6,14 @@ -- Areas of Interest functions perform some nondeterministic computations -- (to estimate the significance); we will set the seeds for the RNGs -- that affect those results to have repeateble results + +-- Moran's I Global +SELECT cdb_crankshaft._cdb_random_seeds(1234); + +SELECT round(moran, 4) As moran, round(significance, 4) As significance + FROM cdb_crankshaft.CDB_AreasOfInterestGlobal('SELECT * FROM ppoints', 'value') m(moran, significance); + +-- Moran's I Local SELECT cdb_crankshaft._cdb_random_seeds(1234); SELECT ppoints.code, m.quads