public void PeekTest() { var hmm = createModel(); var running = new RunningMarkovStatistics <MultivariateNormalDistribution>(hmm); double[][][] sequences = { new[] { new double[] { 1, 2 }, new double[] { 6, 7 }, new double[] { 2, 3 }, }, new[] { new double[] { 2, 2 }, new double[] { 9, 8 }, new double[] { 1, 0 }, }, new[] { new double[] { 8, 7 }, new double[] { 9, 8 }, new double[] { 1, 0 } } }; for (int i = 0; i < sequences.Length; i++) { running.Clear(); double[][] sequence = sequences[i]; for (int j = 0; j < sequence.Length - 1; j++) { running.Push(sequence[j]); } for (int j = 0; j < sequence.Length; j++) { double actual = running.Peek(sequence[j]); double[][] window = sequence.First(2); double expected = hmm.Evaluate(window.Concatenate(sequence[j])); Assert.AreEqual(expected, actual); } } }
public void PeekTest() { var hmm = createModel(); var running = new RunningMarkovStatistics<MultivariateNormalDistribution>(hmm); double[][][] sequences = { new[] { new double[] { 1, 2 }, new double[] { 6, 7 }, new double[] { 2, 3 }, }, new[] { new double[] { 2, 2 }, new double[] { 9, 8 }, new double[] { 1, 0 }, }, new[] { new double[] { 8, 7 }, new double[] { 9, 8 }, new double[] { 1, 0 } } }; for (int i = 0; i < sequences.Length; i++) { running.Clear(); double[][] sequence = sequences[i]; for (int j = 0; j < sequence.Length - 1; j++) running.Push(sequence[j]); for (int j = 0; j < sequence.Length; j++) { double actual = running.Peek(sequence[j]); double[][] window = sequence.Submatrix(2); double expected = hmm.Evaluate(window.Concatenate(sequence[j])); Assert.AreEqual(expected, actual); } } }