Uploaded image for project: 'Commons Math'
  1. Commons Math
  2. MATH-1260

SimpleRegression add new method: getPredictionStdErr(double x)

    XMLWordPrintableJSON

    Details

    • Type: New Feature
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 3.5
    • Fix Version/s: 4.X
    • Labels:
      None

      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:

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

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                PaddyD Patrick Drury
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated: