[jira] [Created] (MATH-619) ADJUSTED R SQUARED INCORRECT IN REGRESSION RESULTS

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Created] (MATH-619) ADJUSTED R SQUARED INCORRECT IN REGRESSION RESULTS

Sebb (Jira)
ADJUSTED R SQUARED INCORRECT IN REGRESSION RESULTS
--------------------------------------------------

                 Key: MATH-619
                 URL: https://issues.apache.org/jira/browse/MATH-619
             Project: Commons Math
          Issue Type: Bug
    Affects Versions: 3.0
         Environment: Java
            Reporter: greg sterijevski
         Attachments: regres

I forgot to cast to double when dividing two integers:

            this.globalFitInfo[ADJRSQ_IDX] = 1.0 -
                    (1.0 - this.globalFitInfo[RSQ_IDX]) *
                    (  nobs / ( (nobs - rank)));
Should be
            this.globalFitInfo[ADJRSQ_IDX] = 1.0 -
                    (1.0 - this.globalFitInfo[RSQ_IDX]) *
                    ( (double) nobs / ( (double) (nobs - rank)));

Patch attached.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Updated] (MATH-619) ADJUSTED R SQUARED INCORRECT IN REGRESSION RESULTS

Sebb (Jira)

     [ https://issues.apache.org/jira/browse/MATH-619?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

greg sterijevski updated MATH-619:
----------------------------------

    Attachment: regres

> ADJUSTED R SQUARED INCORRECT IN REGRESSION RESULTS
> --------------------------------------------------
>
>                 Key: MATH-619
>                 URL: https://issues.apache.org/jira/browse/MATH-619
>             Project: Commons Math
>          Issue Type: Bug
>    Affects Versions: 3.0
>         Environment: Java
>            Reporter: greg sterijevski
>         Attachments: regres
>
>
> I forgot to cast to double when dividing two integers:
>             this.globalFitInfo[ADJRSQ_IDX] = 1.0 -
>                     (1.0 - this.globalFitInfo[RSQ_IDX]) *
>                     (  nobs / ( (nobs - rank)));
> Should be
>             this.globalFitInfo[ADJRSQ_IDX] = 1.0 -
>                     (1.0 - this.globalFitInfo[RSQ_IDX]) *
>                     ( (double) nobs / ( (double) (nobs - rank)));
> Patch attached.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Resolved] (MATH-619) ADJUSTED R SQUARED INCORRECT IN REGRESSION RESULTS

Sebb (Jira)
In reply to this post by Sebb (Jira)

     [ https://issues.apache.org/jira/browse/MATH-619?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Phil Steitz resolved MATH-619.
------------------------------

       Resolution: Fixed
    Fix Version/s: 3.0

Fixed in r1146575.  Lets keep the updates (including test cases :) for RegressionResults on (still open) MATH-607.  We can use separate issues for implementations; but we should keep the updates to RegressionResults attached to that issue.

> ADJUSTED R SQUARED INCORRECT IN REGRESSION RESULTS
> --------------------------------------------------
>
>                 Key: MATH-619
>                 URL: https://issues.apache.org/jira/browse/MATH-619
>             Project: Commons Math
>          Issue Type: Bug
>    Affects Versions: 3.0
>         Environment: Java
>            Reporter: greg sterijevski
>             Fix For: 3.0
>
>         Attachments: regres
>
>
> I forgot to cast to double when dividing two integers:
>             this.globalFitInfo[ADJRSQ_IDX] = 1.0 -
>                     (1.0 - this.globalFitInfo[RSQ_IDX]) *
>                     (  nobs / ( (nobs - rank)));
> Should be
>             this.globalFitInfo[ADJRSQ_IDX] = 1.0 -
>                     (1.0 - this.globalFitInfo[RSQ_IDX]) *
>                     ( (double) nobs / ( (double) (nobs - rank)));
> Patch attached.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira