From 607511fd6b1116920ea0aaa4371405a317cc8e11 Mon Sep 17 00:00:00 2001 From: Phil Steitz Date: Mon, 11 Jan 2016 06:52:30 -0700 Subject: [PATCH] Fixed errors in multiple regression code samples. JIRA: MATH-1316. Thanks to Sanghack Lee. --- src/site/xdoc/userguide/stat.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/site/xdoc/userguide/stat.xml b/src/site/xdoc/userguide/stat.xml index 305795c49..e315954c3 100644 --- a/src/site/xdoc/userguide/stat.xml +++ b/src/site/xdoc/userguide/stat.xml @@ -562,14 +562,14 @@ System.out.println(regression.getInterceptStdErr() ); OLSMultipleLinearRegression regression = new OLSMultipleLinearRegression(); double[] y = new double[]{11.0, 12.0, 13.0, 14.0, 15.0, 16.0}; -double[] x = new double[6][]; +double[][] x = new double[6][]; x[0] = new double[]{0, 0, 0, 0, 0}; x[1] = new double[]{2.0, 0, 0, 0, 0}; x[2] = new double[]{0, 3.0, 0, 0, 0}; x[3] = new double[]{0, 0, 4.0, 0, 0}; x[4] = new double[]{0, 0, 0, 5.0, 0}; x[5] = new double[]{0, 0, 0, 0, 6.0}; -regression.newSample(y, x); +regression.newSampleData(y, x);
Get regression parameters and diagnostics: @@ -593,7 +593,7 @@ double sigma = regression.estimateRegressionStandardError(); GLSMultipleLinearRegression regression = new GLSMultipleLinearRegression(); double[] y = new double[]{11.0, 12.0, 13.0, 14.0, 15.0, 16.0}; -double[] x = new double[6][]; +double[][] x = new double[6][]; x[0] = new double[]{0, 0, 0, 0, 0}; x[1] = new double[]{2.0, 0, 0, 0, 0}; x[2] = new double[]{0, 3.0, 0, 0, 0};