Fixed errors in multiple regression code samples. JIRA: MATH-1316. Thanks to Sanghack Lee.

This commit is contained in:
Phil Steitz 2016-01-11 06:52:30 -07:00
parent a9006aa8b9
commit 607511fd6b
1 changed files with 3 additions and 3 deletions

View File

@ -562,14 +562,14 @@ System.out.println(regression.getInterceptStdErr() );
<source>
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);
</source>
</dd>
<dd>Get regression parameters and diagnostics:
@ -593,7 +593,7 @@ double sigma = regression.estimateRegressionStandardError();
<source>
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};