public IGMNData(IGMN owner, Vector mean) { this.owner = owner; this.gauss = new Gaussian(mean, getStarterCovariance()); this.inputGauss = new Gaussian(mean.Part(0, mean.Elements.Length - 1), getInputStarterCovariance()); Age = 1; Accumlator = 1; }
public void CovarianceMatrixTest() { CovarianceMatrix m = new CovarianceMatrix(new Vector(new double[] { 1, 2, 3, 4, 5, 4, 3, 2, 1 })); m.AddDiad(new Vector(new double[] { 4, 5, 1, 2, 8, 3, 3, 8, 1 }), 0.25); m.AddDiad(new Vector(new double[] { 8, 3, 3, 1, 2, 8, 1, 4, 5 }), 0.25); m.MultiplyScalar(3.73871); m.Covariance.WriteToFile("m.txt"); m.InverseCovariance.WriteToFile("minv.txt"); Console.Out.WriteLine(m.Determinant); Gaussian g = new Gaussian(new Vector(9), m); double likelihood = g.Likelihood(new Vector(new double[] { 1, 10, 0, 0, 0, 0, 0, 0, 10 })); Console.Out.WriteLine(likelihood); }