You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Patrick Drury (JIRA)" <ji...@apache.org> on 2015/08/20 13:09:45 UTC

[jira] [Comment Edited] (MATH-1260) SimpleRegression add new method: getPredictionStdErr(double x)

    [ https://issues.apache.org/jira/browse/MATH-1260?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14704688#comment-14704688 ] 

Patrick Drury edited comment on MATH-1260 at 8/20/15 11:08 AM:
---------------------------------------------------------------

The code snippet is not the answer to a usage question. It is the method which will need to be added to SimpleRegression. xbar is not currently publicly available.


was (Author: paddyd):
The code snippet is not the answer to a usage question. It is the method which will need to be added to SimpleRegression.

> 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}
> Some ad hoc testing has shown that



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