Repository: incubator-systemml Updated Branches: refs/heads/master 1ebe2e178 -> a6428f7d8
[SYSTEMML-1455] Change the term PLAIN_R2 to R2 Closes #500. Project: http://git-wip-us.apache.org/repos/asf/incubator-systemml/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-systemml/commit/a6428f7d Tree: http://git-wip-us.apache.org/repos/asf/incubator-systemml/tree/a6428f7d Diff: http://git-wip-us.apache.org/repos/asf/incubator-systemml/diff/a6428f7d Branch: refs/heads/master Commit: a6428f7d88b39792ccb5440b5bc3bedff4df21de Parents: 1ebe2e1 Author: krishnakalyan3 <krishnakaly...@gmail.com> Authored: Fri May 19 14:01:07 2017 -0700 Committer: Deron Eriksson <de...@us.ibm.com> Committed: Fri May 19 14:01:07 2017 -0700 ---------------------------------------------------------------------- docs/algorithms-regression.md | 16 ++++++++-------- docs/hadoop-batch-mode.md | 10 +++++----- docs/standalone-guide.md | 10 +++++----- scripts/algorithms/GLM-predict.dml | 12 ++++++------ scripts/algorithms/LinearRegCG.dml | 18 +++++++++--------- scripts/algorithms/LinearRegDS.dml | 18 +++++++++--------- scripts/algorithms/StepLinearRegDS.dml | 18 +++++++++--------- 7 files changed, 51 insertions(+), 51 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/a6428f7d/docs/algorithms-regression.md ---------------------------------------------------------------------- diff --git a/docs/algorithms-regression.md b/docs/algorithms-regression.md index 494693c..22c6959 100644 --- a/docs/algorithms-regression.md +++ b/docs/algorithms-regression.md @@ -346,11 +346,11 @@ pair per each line. | AVG\_RES\_Y | Average of the residual $Y - \mathop{\mathrm{pred}}(Y \mid X)$, i.e. residual bias | STDEV\_RES\_Y | Standard Deviation of the residual $Y - \mathop{\mathrm{pred}}(Y \mid X)$ | DISPERSION | GLM-style dispersion, i.e. residual sum of squares / \#deg. fr. -| PLAIN\_R2 | Plain $R^2$ of residual with bias included vs. total average +| R2 | $R^2$ of residual with bias included vs. total average | ADJUSTED\_R2 | Adjusted $R^2$ of residual with bias included vs. total average -| PLAIN\_R2\_NOBIAS | Plain $R^2$ of residual with bias subtracted vs. total average +| R2\_NOBIAS | Plain $R^2$ of residual with bias subtracted vs. total average | ADJUSTED\_R2\_NOBIAS | Adjusted $R^2$ of residual with bias subtracted vs. total average -| PLAIN\_R2\_VS\_0 | * Plain $R^2$ of residual with bias included vs. zero constant +| R2\_VS\_0 | * $R^2$ of residual with bias included vs. zero constant | ADJUSTED\_R2\_VS\_0 | * Adjusted $R^2$ of residual with bias included vs. zero constant \* The last two statistics are only printed if there is no intercept (`icpt=0`) @@ -471,7 +471,7 @@ $n\,{-}\,m\,{-}\,1$ is positive and the regularization constant $\lambda$ is negligible or zero. The formulas for $\sigma$ and $R^2$Â are: -$$R^2_{\textrm{plain}} = 1 - \frac{\mathrm{RSS}}{\mathrm{TSS}},\quad +$$R^2 = 1 - \frac{\mathrm{RSS}}{\mathrm{TSS}},\quad \sigma \,=\, \sqrt{\frac{\mathrm{RSS}}{n - m - 1}},\quad R^2_{\textrm{adj.}} = 1 - \frac{\sigma^2 (n-1)}{\mathrm{TSS}}$$ @@ -1881,9 +1881,9 @@ statistic; | AVG\_RES\_Y | + | | $Y$-column residual average of $Y - pred. mean(Y\\|X)$ | | STDEV\_RES\_Y | + | | $Y$-column residual st. dev. of $Y - pred. mean(Y\\|X)$ | | PRED\_STDEV\_RES | + | + | Model-predicted $Y$-column residual st. deviation| -| PLAIN\_R2 | + | | Plain $R^2$ of $Y$-column residual with bias included | +| R2 | + | | $R^2$ of $Y$-column residual with bias included | | ADJUSTED\_R2 | + | | Adjusted $R^2$ of $Y$-column residual w. bias included | -| PLAIN\_R2\_NOBIAS | + | | Plain $R^2$ of $Y$-column residual, bias subtracted | +| R2\_NOBIAS | + | | $R^2$ of $Y$-column residual, bias subtracted | | ADJUSTED\_R2\_NOBIAS | + | | Adjusted $R^2$ of $Y$-column residual, bias subtracted | * * * @@ -2114,7 +2114,7 @@ $m$Â with the intercept or $m+1$ without the intercept. | Statistic | Formula | | --------------------- | ------------- | -| $\texttt{PLAIN_R2}_j$ | $$ \displaystyle 1 - \frac{\sum\limits_{i=1}^n \,(y_{i,j} - \mu_{i,j})^2}{\sum\limits_{i=1}^n \Big(y_{i,j} - \frac{N_{i\mathstrut}}{N^{\mathstrut}} \sum\limits_{i'=1}^n y_{i',j} \Big)^{2}} $$ +| $\texttt{R2}_j$ | $$ \displaystyle 1 - \frac{\sum\limits_{i=1}^n \,(y_{i,j} - \mu_{i,j})^2}{\sum\limits_{i=1}^n \Big(y_{i,j} - \frac{N_{i\mathstrut}}{N^{\mathstrut}} \sum\limits_{i'=1}^n y_{i',j} \Big)^{2}} $$ | $\texttt{ADJUSTED_R2}_j$ | $$ \displaystyle 1 - {\textstyle\frac{N_{\mathstrut} - 1}{N^{\mathstrut} - m}} \, \frac{\sum\limits_{i=1}^n \,(y_{i,j} - \mu_{i,j})^2}{\sum\limits_{i=1}^n \Big(y_{i,j} - \frac{N_{i\mathstrut}}{N^{\mathstrut}} \sum\limits_{i'=1}^n y_{i',j} \Big)^{2}} $$ @@ -2125,7 +2125,7 @@ $m$Â with the intercept or $m+1$ without the intercept. | Statistic | Formula | | --------------------- | ------------- | -| $\texttt{PLAIN_R2_NOBIAS}_j$ | $$ \displaystyle 1 - \frac{\sum\limits_{i=1}^n \Big(y_{i,j} \,{-}\, \mu_{i,j} \,{-}\, \frac{N_{i\mathstrut}}{N^{\mathstrut}} \sum\limits_{i'=1}^n (y_{i',j} \,{-}\, \mu_{i',j}) \Big)^{2}}{\sum\limits_{i=1}^n \Big(y_{i,j} - \frac{N_{i\mathstrut}}{N^{\mathstrut}} \sum\limits_{i'=1}^n y_{i',j} \Big)^{2}} $$ +| $\texttt{R2_NOBIAS}_j$ | $$ \displaystyle 1 - \frac{\sum\limits_{i=1}^n \Big(y_{i,j} \,{-}\, \mu_{i,j} \,{-}\, \frac{N_{i\mathstrut}}{N^{\mathstrut}} \sum\limits_{i'=1}^n (y_{i',j} \,{-}\, \mu_{i',j}) \Big)^{2}}{\sum\limits_{i=1}^n \Big(y_{i,j} - \frac{N_{i\mathstrut}}{N^{\mathstrut}} \sum\limits_{i'=1}^n y_{i',j} \Big)^{2}} $$ | $\texttt{ADJUSTED_R2_NOBIAS}_j$ | $$ \displaystyle 1 - {\textstyle\frac{N_{\mathstrut} - 1}{N^{\mathstrut} - m'}} \, \frac{\sum\limits_{i=1}^n \Big(y_{i,j} \,{-}\, \mu_{i,j} \,{-}\, \frac{N_{i\mathstrut}}{N^{\mathstrut}} \sum\limits_{i'=1}^n (y_{i',j} \,{-}\, \mu_{i',j}) \Big)^{2}}{\sum\limits_{i=1}^n \Big(y_{i,j} - \frac{N_{i\mathstrut}}{N^{\mathstrut}} \sum\limits_{i'=1}^n y_{i',j} \Big)^{2}} $$ http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/a6428f7d/docs/hadoop-batch-mode.md ---------------------------------------------------------------------- diff --git a/docs/hadoop-batch-mode.md b/docs/hadoop-batch-mode.md index 3af7c0c..37df064 100644 --- a/docs/hadoop-batch-mode.md +++ b/docs/hadoop-batch-mode.md @@ -760,11 +760,11 @@ Let's go ahead and run the SystemML example from the GitHub README. AVG_RES_Y,1.5905895170230406E-10 STDEV_RES_Y,2.0668015575844624E-8 DISPERSION,4.262683023432828E-16 - PLAIN_R2,1.0 + R2,1.0 ADJUSTED_R2,1.0 - PLAIN_R2_NOBIAS,1.0 + R2_NOBIAS,1.0 ADJUSTED_R2_NOBIAS,1.0 - PLAIN_R2_VS_0,1.0 + R2_VS_0,1.0 ADJUSTED_R2_VS_0,1.0 Writing the output matrix... END LINEAR REGRESSION SCRIPT @@ -795,9 +795,9 @@ Let's go ahead and run the SystemML example from the GitHub README. AVG_RES_Y,1,,2.5577864570734575E-10 STDEV_RES_Y,1,,2.390848397359923E-8 PRED_STDEV_RES,1,TRUE,1.0 - PLAIN_R2,1,,1.0 + R2,1,,1.0 ADJUSTED_R2,1,,1.0 - PLAIN_R2_NOBIAS,1,,1.0 + R2_NOBIAS,1,,1.0 ADJUSTED_R2_NOBIAS,1,,1.0 15/11/17 15:51:17 INFO api.DMLScript: SystemML Statistics: Total execution time: 0.269 sec. http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/a6428f7d/docs/standalone-guide.md ---------------------------------------------------------------------- diff --git a/docs/standalone-guide.md b/docs/standalone-guide.md index 586e56e..a2a95d4 100644 --- a/docs/standalone-guide.md +++ b/docs/standalone-guide.md @@ -527,11 +527,11 @@ The LinearRegDS.dml script generates statistics to standard output similar to th AVG_RES_Y,-3.3127468704080085E-10 STDEV_RES_Y,1.7231785003947183E-8 DISPERSION,2.963950542926297E-16 - PLAIN_R2,1.0 + R2,1.0 ADJUSTED_R2,1.0 - PLAIN_R2_NOBIAS,1.0 + R2_NOBIAS,1.0 ADJUSTED_R2_NOBIAS,1.0 - PLAIN_R2_VS_0,1.0 + R2_VS_0,1.0 ADJUSTED_R2_VS_0,1.0 Writing the output matrix... END LINEAR REGRESSION SCRIPT @@ -572,9 +572,9 @@ This generates statistics similar to the following to standard output. AVG_RES_Y,1,,-4.1450397073455047E-10 STDEV_RES_Y,1,,2.0519206226041048E-8 PRED_STDEV_RES,1,TRUE,1.0 - PLAIN_R2,1,,1.0 + R2,1,,1.0 ADJUSTED_R2,1,,1.0 - PLAIN_R2_NOBIAS,1,,1.0 + R2_NOBIAS,1,,1.0 ADJUSTED_R2_NOBIAS,1,,1.0 http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/a6428f7d/scripts/algorithms/GLM-predict.dml ---------------------------------------------------------------------- diff --git a/scripts/algorithms/GLM-predict.dml b/scripts/algorithms/GLM-predict.dml index e24b16f..251d85a 100644 --- a/scripts/algorithms/GLM-predict.dml +++ b/scripts/algorithms/GLM-predict.dml @@ -75,9 +75,9 @@ # AVG_RES_Y + Average of column residual, i.e. of Y - mean(Y|X) # STDEV_RES_Y + St.Dev. of column residual, i.e. of Y - mean(Y|X) # PRED_STDEV_RES + + Model-predicted St.Dev. of column residual -# PLAIN_R2 + Plain R^2 of Y column residual with bias included +# R2 + R^2 of Y column residual with bias included # ADJUSTED_R2 + Adjusted R^2 of Y column residual with bias included -# PLAIN_R2_NOBIAS + Plain R^2 of Y column residual with bias subtracted +# R2_NOBIAS + R^2 of Y column residual with bias subtracted # ADJUSTED_R2_NOBIAS + Adjusted R^2 of Y column residual with bias subtracted # --------------------------------------------------------------------------------------------- # @@ -284,9 +284,9 @@ if (fileY != " ") } else { var_res_Y = matrix (0.0, rows = 1, cols = ncol (Y)) / 0.0; } - plain_R2_nobias = 1 - ss_avg_res_Y / ss_avg_tot_Y; + R2_nobias = 1 - ss_avg_res_Y / ss_avg_tot_Y; adjust_R2_nobias = 1 - var_res_Y / var_tot_Y; - plain_R2 = 1 - ss_res_Y / ss_avg_tot_Y; + R2 = 1 - ss_res_Y / ss_avg_tot_Y; if (df_ss_res_Y > 0) { adjust_R2 = 1 - (ss_res_Y / df_ss_res_Y) / var_tot_Y; } else { @@ -320,9 +320,9 @@ if (fileY != " ") str = append (str, "AVG_RES_Y," + i + ",," + as.scalar (avg_res_Y [1, i])); str = append (str, "STDEV_RES_Y," + i + ",," + as.scalar (sqrt (var_res_Y [1, i]))); str = append (str, "PRED_STDEV_RES," + i + ",TRUE," + as.scalar (sqrt (predicted_avg_var_res_Y [1, i]))); - str = append (str, "PLAIN_R2," + i + ",," + as.scalar (plain_R2 [1, i])); + str = append (str, "R2," + i + ",," + as.scalar (R2 [1, i])); str = append (str, "ADJUSTED_R2," + i + ",," + as.scalar (adjust_R2 [1, i])); - str = append (str, "PLAIN_R2_NOBIAS," + i + ",," + as.scalar (plain_R2_nobias [1, i])); + str = append (str, "R2_NOBIAS," + i + ",," + as.scalar (R2_nobias [1, i])); str = append (str, "ADJUSTED_R2_NOBIAS," + i + ",," + as.scalar (adjust_R2_nobias [1, i])); } http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/a6428f7d/scripts/algorithms/LinearRegCG.dml ---------------------------------------------------------------------- diff --git a/scripts/algorithms/LinearRegCG.dml b/scripts/algorithms/LinearRegCG.dml index 25e5862..9ba7e89 100644 --- a/scripts/algorithms/LinearRegCG.dml +++ b/scripts/algorithms/LinearRegCG.dml @@ -59,11 +59,11 @@ # AVG_RES_Y Average of the residual Y - pred(Y|X), i.e. residual bias # STDEV_RES_Y Standard Deviation of the residual Y - pred(Y|X) # DISPERSION GLM-style dispersion, i.e. residual sum of squares / # deg. fr. -# PLAIN_R2 Plain R^2 of residual with bias included vs. total average +# R2 R^2 of residual with bias included vs. total average # ADJUSTED_R2 Adjusted R^2 of residual with bias included vs. total average -# PLAIN_R2_NOBIAS Plain R^2 of residual with bias subtracted vs. total average +# R2_NOBIAS R^2 of residual with bias subtracted vs. total average # ADJUSTED_R2_NOBIAS Adjusted R^2 of residual with bias subtracted vs. total average -# PLAIN_R2_VS_0 * Plain R^2 of residual with bias included vs. zero constant +# R2_VS_0 * R^2 of residual with bias included vs. zero constant # ADJUSTED_R2_VS_0 * Adjusted R^2 of residual with bias included vs. zero constant # ------------------------------------------------------------------------------------- # * The last two statistics are only printed if there is no intercept (icpt=0) @@ -223,7 +223,7 @@ avg_res = sum (y_residual) / n; ss_res = sum (y_residual ^ 2); ss_avg_res = ss_res - n * avg_res ^ 2; -plain_R2 = 1 - ss_res / ss_avg_tot; +R2 = 1 - ss_res / ss_avg_tot; if (n > m_ext) { dispersion = ss_res / (n - m_ext); adjusted_R2 = 1 - dispersion / (ss_avg_tot / (n - 1)); @@ -232,7 +232,7 @@ if (n > m_ext) { adjusted_R2 = 0.0 / 0.0; } -plain_R2_nobias = 1 - ss_avg_res / ss_avg_tot; +R2_nobias = 1 - ss_avg_res / ss_avg_tot; deg_freedom = n - m - 1; if (deg_freedom > 0) { var_res = ss_avg_res / deg_freedom; @@ -243,7 +243,7 @@ if (deg_freedom > 0) { print ("Warning: zero or negative number of degrees of freedom."); } -plain_R2_vs_0 = 1 - ss_res / ss_tot; +R2_vs_0 = 1 - ss_res / ss_tot; if (n > m) { adjusted_R2_vs_0 = 1 - (ss_res / (n - m)) / (ss_tot / n); } else { @@ -255,12 +255,12 @@ str = append (str, "STDEV_TOT_Y," + sqrt (var_tot)); # Standard Dev str = append (str, "AVG_RES_Y," + avg_res); # Average of the residual Y - pred(Y|X), i.e. residual bias str = append (str, "STDEV_RES_Y," + sqrt (var_res)); # Standard Deviation of the residual Y - pred(Y|X) str = append (str, "DISPERSION," + dispersion); # GLM-style dispersion, i.e. residual sum of squares / # d.f. -str = append (str, "PLAIN_R2," + plain_R2); # Plain R^2 of residual with bias included vs. total average +str = append (str, "R2," + R2); # R^2 of residual with bias included vs. total average str = append (str, "ADJUSTED_R2," + adjusted_R2); # Adjusted R^2 of residual with bias included vs. total average -str = append (str, "PLAIN_R2_NOBIAS," + plain_R2_nobias); # Plain R^2 of residual with bias subtracted vs. total average +str = append (str, "R2_NOBIAS," + R2_nobias); # R^2 of residual with bias subtracted vs. total average str = append (str, "ADJUSTED_R2_NOBIAS," + adjusted_R2_nobias); # Adjusted R^2 of residual with bias subtracted vs. total average if (intercept_status == 0) { - str = append (str, "PLAIN_R2_VS_0," + plain_R2_vs_0); # Plain R^2 of residual with bias included vs. zero constant + str = append (str, "R2_VS_0," + R2_vs_0); # R^2 of residual with bias included vs. zero constant str = append (str, "ADJUSTED_R2_VS_0," + adjusted_R2_vs_0); # Adjusted R^2 of residual with bias included vs. zero constant } http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/a6428f7d/scripts/algorithms/LinearRegDS.dml ---------------------------------------------------------------------- diff --git a/scripts/algorithms/LinearRegDS.dml b/scripts/algorithms/LinearRegDS.dml index 2f55b41..10def79 100644 --- a/scripts/algorithms/LinearRegDS.dml +++ b/scripts/algorithms/LinearRegDS.dml @@ -55,11 +55,11 @@ # AVG_RES_Y Average of the residual Y - pred(Y|X), i.e. residual bias # STDEV_RES_Y Standard Deviation of the residual Y - pred(Y|X) # DISPERSION GLM-style dispersion, i.e. residual sum of squares / # deg. fr. -# PLAIN_R2 Plain R^2 of residual with bias included vs. total average +# R2 R^2 of residual with bias included vs. total average # ADJUSTED_R2 Adjusted R^2 of residual with bias included vs. total average -# PLAIN_R2_NOBIAS Plain R^2 of residual with bias subtracted vs. total average +# R2_NOBIAS R^2 of residual with bias subtracted vs. total average # ADJUSTED_R2_NOBIAS Adjusted R^2 of residual with bias subtracted vs. total average -# PLAIN_R2_VS_0 * Plain R^2 of residual with bias included vs. zero constant +# R2_VS_0 * R^2 of residual with bias included vs. zero constant # ADJUSTED_R2_VS_0 * Adjusted R^2 of residual with bias included vs. zero constant # ------------------------------------------------------------------------------------- # * The last two statistics are only printed if there is no intercept (icpt=0) @@ -165,7 +165,7 @@ avg_res = sum (y_residual) / n; ss_res = sum (y_residual ^ 2); ss_avg_res = ss_res - n * avg_res ^ 2; -plain_R2 = 1 - ss_res / ss_avg_tot; +R2 = 1 - ss_res / ss_avg_tot; if (n > m_ext) { dispersion = ss_res / (n - m_ext); adjusted_R2 = 1 - dispersion / (ss_avg_tot / (n - 1)); @@ -174,7 +174,7 @@ if (n > m_ext) { adjusted_R2 = 0.0 / 0.0; } -plain_R2_nobias = 1 - ss_avg_res / ss_avg_tot; +R2_nobias = 1 - ss_avg_res / ss_avg_tot; deg_freedom = n - m - 1; if (deg_freedom > 0) { var_res = ss_avg_res / deg_freedom; @@ -185,7 +185,7 @@ if (deg_freedom > 0) { print ("Warning: zero or negative number of degrees of freedom."); } -plain_R2_vs_0 = 1 - ss_res / ss_tot; +R2_vs_0 = 1 - ss_res / ss_tot; if (n > m) { adjusted_R2_vs_0 = 1 - (ss_res / (n - m)) / (ss_tot / n); } else { @@ -197,12 +197,12 @@ str = append (str, "STDEV_TOT_Y," + sqrt (var_tot)); # Standard Dev str = append (str, "AVG_RES_Y," + avg_res); # Average of the residual Y - pred(Y|X), i.e. residual bias str = append (str, "STDEV_RES_Y," + sqrt (var_res)); # Standard Deviation of the residual Y - pred(Y|X) str = append (str, "DISPERSION," + dispersion); # GLM-style dispersion, i.e. residual sum of squares / # d.f. -str = append (str, "PLAIN_R2," + plain_R2); # Plain R^2 of residual with bias included vs. total average +str = append (str, "R2," + R2); # R^2 of residual with bias included vs. total average str = append (str, "ADJUSTED_R2," + adjusted_R2); # Adjusted R^2 of residual with bias included vs. total average -str = append (str, "PLAIN_R2_NOBIAS," + plain_R2_nobias); # Plain R^2 of residual with bias subtracted vs. total average +str = append (str, "R2_NOBIAS," + R2_nobias); # R^2 of residual with bias subtracted vs. total average str = append (str, "ADJUSTED_R2_NOBIAS," + adjusted_R2_nobias); # Adjusted R^2 of residual with bias subtracted vs. total average if (intercept_status == 0) { - str = append (str, "PLAIN_R2_VS_0," + plain_R2_vs_0); # Plain R^2 of residual with bias included vs. zero constant + str = append (str, "R2_VS_0," + R2_vs_0); # R^2 of residual with bias included vs. zero constant str = append (str, "ADJUSTED_R2_VS_0," + adjusted_R2_vs_0); # Adjusted R^2 of residual with bias included vs. zero constant } http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/a6428f7d/scripts/algorithms/StepLinearRegDS.dml ---------------------------------------------------------------------- diff --git a/scripts/algorithms/StepLinearRegDS.dml b/scripts/algorithms/StepLinearRegDS.dml index 2efb2bb..00f50ee 100644 --- a/scripts/algorithms/StepLinearRegDS.dml +++ b/scripts/algorithms/StepLinearRegDS.dml @@ -57,11 +57,11 @@ # AVG_RES_Y Average of the residual Y - pred(Y|X), i.e. residual bias # STDEV_RES_Y Standard Deviation of the residual Y - pred(Y|X) # DISPERSION GLM-style dispersion, i.e. residual sum of squares / # deg. fr. -# PLAIN_R2 Plain R^2 of residual with bias included vs. total average +# R2 R^2 of residual with bias included vs. total average # ADJUSTED_R2 Adjusted R^2 of residual with bias included vs. total average -# PLAIN_R2_NOBIAS Plain R^2 of residual with bias subtracted vs. total average +# R2_NOBIAS R^2 of residual with bias subtracted vs. total average # ADJUSTED_R2_NOBIAS Adjusted R^2 of residual with bias subtracted vs. total average -# PLAIN_R2_VS_0 * Plain R^2 of residual with bias included vs. zero constant +# R2_VS_0 * R^2 of residual with bias included vs. zero constant # ADJUSTED_R2_VS_0 * Adjusted R^2 of residual with bias included vs. zero constant # ------------------------------------------------------------------------------------- # * The last two statistics are only printed if there is no intercept (icpt=0) @@ -271,7 +271,7 @@ linear_regression = function (Matrix[Double] X, Matrix[Double] y, Double m_orig, # ss_res = sum (y_residual ^ 2); ss_avg_res = ss_res - n * avg_res ^ 2; - plain_R2 = 1 - ss_res / ss_avg_tot; + R2 = 1 - ss_res / ss_avg_tot; if (n > m_ext) { dispersion = ss_res / (n - m_ext); adjusted_R2 = 1 - dispersion / (ss_avg_tot / (n - 1)); @@ -280,7 +280,7 @@ linear_regression = function (Matrix[Double] X, Matrix[Double] y, Double m_orig, adjusted_R2 = 0.0 / 0.0; } - plain_R2_nobias = 1 - ss_avg_res / ss_avg_tot; + R2_nobias = 1 - ss_avg_res / ss_avg_tot; deg_freedom = n - m - 1; if (deg_freedom > 0) { var_res = ss_avg_res / deg_freedom; @@ -291,7 +291,7 @@ linear_regression = function (Matrix[Double] X, Matrix[Double] y, Double m_orig, print ("Warning: zero or negative number of degrees of freedom."); } - plain_R2_vs_0 = 1 - ss_res / ss_tot; + R2_vs_0 = 1 - ss_res / ss_tot; if (n > m) { adjusted_R2_vs_0 = 1 - (ss_res / (n - m)) / (ss_tot / n); } else { @@ -303,12 +303,12 @@ linear_regression = function (Matrix[Double] X, Matrix[Double] y, Double m_orig, str = append (str, "AVG_RES_Y," + avg_res); # Average of the residual Y - pred(Y|X), i.e. residual bias str = append (str, "STDEV_RES_Y," + sqrt (var_res)); # Standard Deviation of the residual Y - pred(Y|X) str = append (str, "DISPERSION," + dispersion); # GLM-style dispersion, i.e. residual sum of squares / # d.f. - str = append (str, "PLAIN_R2," + plain_R2); # Plain R^2 of residual with bias included vs. total average + str = append (str, "R2," + R2); # R^2 of residual with bias included vs. total average str = append (str, "ADJUSTED_R2," + adjusted_R2); # Adjusted R^2 of residual with bias included vs. total average - str = append (str, "PLAIN_R2_NOBIAS," + plain_R2_nobias); # Plain R^2 of residual with bias subtracted vs. total average + str = append (str, "R2_NOBIAS," + R2_nobias); # R^2 of residual with bias subtracted vs. total average str = append (str, "ADJUSTED_R2_NOBIAS," + adjusted_R2_nobias); # Adjusted R^2 of residual with bias subtracted vs. total average if (intercept_status == 0) { - str = append (str, "PLAIN_R2_VS_0," + plain_R2_vs_0); # Plain R^2 of residual with bias included vs. zero constant + str = append (str, "R2_VS_0," + R2_vs_0); # R^2 of residual with bias included vs. zero constant str = append (str, "ADJUSTED_R2_VS_0," + adjusted_R2_vs_0); # Adjusted R^2 of residual with bias included vs. zero constant }