using System;
namespace LinearRegression
{
class LinearRegressionProgram
{
static void Main(string[] args)
{
Console.WriteLine("Begin linear regression demo");
// Generate synthetic data
// Create design matrix
// Solve for LR coefficients
// Calculate R-squared value
// Do a prediction
Console.WriteLine("End linear regression demo");
Console.ReadLine();
}
static double Income(double x1, double x2,
double x3, double[] coef) { . . }
static double RSquared(double[][] data,
double[] coef) { . . }
static double[][] DummyData(int rows,
int seed) { . . }
static double[][] Design(double[][] data) { . . }
static double[] Solve(double[][] design) { . . }
static void ShowMatrix(double[][] m, int dec) { . . }
static void ShowVector(double[] v, int dec) { . . }
// ----------
static double[][] MatrixTranspose(double[][] matrix)
{ . . }
static double[][] MatrixProduct(double[][] matrixA,
double[][] matrixB) { . . }
static double[][] MatrixInverse(double[][] matrix)
{ . . }
// Other matrix routines here
}
} // ns