Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Have you tried creating a <a href="http://commons.apache.org/math/userguide/stat.html#a1.7_Covariance_and_correlation" rel="nofollow noreferrer">Covariance matrix directly from your data</a>?</p> <pre><code>new Covariance().computeCovarianceMatrix(data) </code></pre> <p>Using the information in the comment, we know that there are 3 independent, 1 dependent variables and 200 samples. That implies that you will have a data array with 4 columns and 200 rows. The end result will look something like this (typing everything out explicitly in order to try to explain what I mean):</p> <pre><code>double [] data = new double [4][]; data[0] = new double[]{y[0], x[0][0], x[1][0], x[2][0]}; data[1] = new double[]{y[1], x[0][1], x[1][1], x[2][1]}; data[2] = new double[]{y[2], x[0][2], x[1][2], x[2][2]}; // ... etc. data[199] = new double[]{y[199], x[0][199], x[1][199], x[2][199]}; Covariance covariance = new Covariance().computeCovarianceMatrix(data); double [][] omega = covariance.getCovarianceMatrix().getData(); </code></pre> <p>Then, <a href="http://commons.apache.org/math/userguide/stat.html#a1.5_Multiple_linear_regression" rel="nofollow noreferrer">when you're doing your actual regression</a>, you have your covariance matrix:</p> <pre><code>MultipleLinearRegression regression = new GLSMultipleLinearRegression(); // Assumes you put your independent variables in x and dependent in y // Also assumes that you made your covariance matrix as shown above regression.addData(y, x, omega); // we do need covariance </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload