mirror of
https://github.com/apache/commons-math.git
synced 2025-02-08 11:05:56 +00:00
Added casts to prevent integer division. JIRA: MATH-619
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1146575 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
2123f7805b
commit
b8ed51d4a0
@ -86,6 +86,7 @@ public class RegressionResults implements Serializable {
|
||||
this.globalFitInfo[SST_IDX] = containsConstant ?
|
||||
(sumysq - sumy * sumy / ((double) nobs)) : sumysq;
|
||||
}
|
||||
|
||||
this.globalFitInfo[SSE_IDX] = sse;
|
||||
this.globalFitInfo[MSE_IDX] = this.globalFitInfo[SSE_IDX] /
|
||||
((double) (nobs - rank));
|
||||
@ -94,8 +95,9 @@ public class RegressionResults implements Serializable {
|
||||
this.globalFitInfo[SST_IDX];
|
||||
|
||||
if (!containsConstant) {
|
||||
this.globalFitInfo[ADJRSQ_IDX] = 1.0 - (1.0 - this.globalFitInfo[RSQ_IDX]) *
|
||||
(nobs / (nobs - rank));
|
||||
this.globalFitInfo[ADJRSQ_IDX] = 1.0 -
|
||||
(1.0 - this.globalFitInfo[RSQ_IDX]) *
|
||||
( (double) nobs / ( (double) (nobs - rank)));
|
||||
} else {
|
||||
this.globalFitInfo[ADJRSQ_IDX] = 1.0 - (sse * (nobs - 1.0)) /
|
||||
(globalFitInfo[SST_IDX] * (nobs - rank));
|
||||
|
Loading…
x
Reference in New Issue
Block a user