public void MultivariateLinearRegressionAgreement()
        {
            Random rng = new Random(1);

            MultivariateSample SA = new MultivariateSample(2);
            for (int i = 0; i < 10; i++) {
                SA.Add(rng.NextDouble(), rng.NextDouble());
            }
            FitResult RA = SA.LinearRegression(0);
            ColumnVector PA = RA.Parameters;
            SymmetricMatrix CA = RA.CovarianceMatrix;

            MultivariateSample SB = SA.Columns(1, 0);
            FitResult RB = SB.LinearRegression(1);
            ColumnVector PB = RB.Parameters;
            SymmetricMatrix CB = RB.CovarianceMatrix;

            Assert.IsTrue(TestUtilities.IsNearlyEqual(PA[0], PB[1])); Assert.IsTrue(TestUtilities.IsNearlyEqual(PA[1], PB[0]));
            Assert.IsTrue(TestUtilities.IsNearlyEqual(CA[0, 0], CB[1, 1])); Assert.IsTrue(TestUtilities.IsNearlyEqual(CA[0, 1], CB[1, 0])); Assert.IsTrue(TestUtilities.IsNearlyEqual(CA[1, 1], CB[0, 0]));
            Assert.IsTrue(TestUtilities.IsNearlyEqual(RA.GoodnessOfFit.Statistic, RB.GoodnessOfFit.Statistic));

            BivariateSample SC = SA.TwoColumns(1, 0);
            FitResult RC = SC.LinearRegression();
            ColumnVector PC = RC.Parameters;
            SymmetricMatrix CC = RC.CovarianceMatrix;

            Assert.IsTrue(TestUtilities.IsNearlyEqual(PA, PC));
            Assert.IsTrue(TestUtilities.IsNearlyEqual(CA, CC));
            Assert.IsTrue(TestUtilities.IsNearlyEqual(RA.GoodnessOfFit.Statistic, RC.GoodnessOfFit.Statistic));
        }