[GRASS-SVN] r72787 - grass/trunk/lib/stats
svn_grass at osgeo.org
svn_grass at osgeo.org
Sat Jun 9 09:56:07 PDT 2018
Author: mmetz
Date: 2018-06-09 09:56:07 -0700 (Sat, 09 Jun 2018)
New Revision: 72787
Modified:
grass/trunk/lib/stats/c_kurt.c
grass/trunk/lib/stats/c_reg.c
grass/trunk/lib/stats/c_skew.c
grass/trunk/lib/stats/c_var.c
Log:
libstats: sum of weights must be DCELL; fix regression t value
Modified: grass/trunk/lib/stats/c_kurt.c
===================================================================
--- grass/trunk/lib/stats/c_kurt.c 2018-06-09 15:39:57 UTC (rev 72786)
+++ grass/trunk/lib/stats/c_kurt.c 2018-06-09 16:56:07 UTC (rev 72787)
@@ -46,7 +46,7 @@
void w_kurt(DCELL * result, DCELL(*values)[2], int n, const void *closure)
{
DCELL sum, ave, sumsq, sumqt, var;
- int count;
+ DCELL count;
int i;
sum = 0.0;
Modified: grass/trunk/lib/stats/c_reg.c
===================================================================
--- grass/trunk/lib/stats/c_reg.c 2018-06-09 15:39:57 UTC (rev 72786)
+++ grass/trunk/lib/stats/c_reg.c 2018-06-09 16:56:07 UTC (rev 72787)
@@ -52,7 +52,7 @@
denom += (DCELL) i * i;
denom -= count * xbar * xbar;
- if (which >= REGRESSION_COEFF_DET) {
+ if (which >= REGRESSION_COEFF_DET || which == REGRESSION_T) {
denom2 = 0.0;
for (i = 0; i < n; i++)
if (!Rast_is_d_null_value(&values[i]))
@@ -142,11 +142,11 @@
denom = 0.0;
for (i = 0; i < n; i++)
if (!Rast_is_d_null_value(&values[i][0]))
- denom += (DCELL) i *i * values[i][1];
+ denom += (DCELL) i * i * values[i][1];
denom -= count * xbar * xbar;
- if (which == REGRESSION_COEFF_DET) {
+ if (which == REGRESSION_COEFF_DET || which == REGRESSION_T) {
denom2 = 0.0;
for (i = 0; i < n; i++)
if (!Rast_is_d_null_value(&values[i][0]))
Modified: grass/trunk/lib/stats/c_skew.c
===================================================================
--- grass/trunk/lib/stats/c_skew.c 2018-06-09 15:39:57 UTC (rev 72786)
+++ grass/trunk/lib/stats/c_skew.c 2018-06-09 16:56:07 UTC (rev 72787)
@@ -48,7 +48,7 @@
void w_skew(DCELL * result, DCELL(*values)[2], int n, const void *closure)
{
DCELL sum, ave, sumsq, sumcb, sdev;
- int count;
+ DCELL count;
int i;
sum = 0.0;
Modified: grass/trunk/lib/stats/c_var.c
===================================================================
--- grass/trunk/lib/stats/c_var.c 2018-06-09 15:39:57 UTC (rev 72786)
+++ grass/trunk/lib/stats/c_var.c 2018-06-09 16:56:07 UTC (rev 72787)
@@ -43,7 +43,7 @@
void w_var(DCELL * result, DCELL(*values)[2], int n, const void *closure)
{
DCELL sum, ave, sumsq;
- int count;
+ DCELL count;
int i;
sum = 0.0;
More information about the grass-commit
mailing list