commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Patrick Drury (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (MATH-1260) SimpleRegression add new method: getPredictionStdErr(double x)
Date Thu, 20 Aug 2015 11:11:45 GMT

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

Patrick Drury updated MATH-1260:
--------------------------------
    Description: 
I would like to be able to get the standard error of a predicted y value given an x value
for a SimpleRegression instance.

I believe (but I don't know) that it's as simple as something like adding the following to
SimpleRegression:

{code:java}
public double getPredictionStdErr(double x) {
    if( !hasIntercept ){
        return Double.NaN;
    }
    return FastMath.sqrt(
         getMeanSquareError() * ((1d / n) + ((xbar - x) * (xbar - x)) / sumXX));
}
{code}





  was:
I would like to be able to get the standard error of a predicted y value given an x value
for a SimpleRegression instance.

I believe (but I don't know) that it's as simple as something like adding the following to
SimpleRegression:

{code:java}
public double getPredictionStdErr(double x) {
    if( !hasIntercept ){
        return Double.NaN;
    }
    return FastMath.sqrt(
         getMeanSquareError() * ((1d / n) + ((xbar - x) * (xbar - x)) / sumXX));
}
{code}

Some ad hoc testing has shown that




> SimpleRegression add new method: getPredictionStdErr(double x)
> --------------------------------------------------------------
>
>                 Key: MATH-1260
>                 URL: https://issues.apache.org/jira/browse/MATH-1260
>             Project: Commons Math
>          Issue Type: New Feature
>    Affects Versions: 3.5
>            Reporter: Patrick Drury
>
> I would like to be able to get the standard error of a predicted y value given an x value
for a SimpleRegression instance.
> I believe (but I don't know) that it's as simple as something like adding the following
to SimpleRegression:
> {code:java}
> public double getPredictionStdErr(double x) {
>     if( !hasIntercept ){
>         return Double.NaN;
>     }
>     return FastMath.sqrt(
>          getMeanSquareError() * ((1d / n) + ((xbar - x) * (xbar - x)) / sumXX));
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message