public IPredictionResult Predict(PredictorType predictorType, double[][] observations, int numberOfIterations, double likelihoodTolerance)
        {
            var model = (HiddenMarkovModelWeightedMixtureDistribution)HiddenMarkovModelFactory.GetModel <HiddenMarkovModelWeightedMixtureDistribution, Mixture <IMultivariateDistribution> >(new ModelCreationParameters <Mixture <IMultivariateDistribution> > {
                Pi = _pi, TransitionProbabilityMatrix = _transitionProbabilityMatrix, Emissions = _emission
            });                                                                                                                                                                                                                                                                                                                                            //HiddenMarkovModelStateFactory.GetState(new ModelCreationParameters<Mixture<IMultivariateDistribution>> { Pi = _pi, TransitionProbabilityMatrix = _transitionProbabilityMatrix, Emissions = _emission });

            model.Normalized = Normalized;
            var request = new PredictionRequest();

            request.TrainingSet  = observations;
            request.NumberOfDays = 1;
            request.Tolerance    = PREDICTION_LIKELIHOOD_TOLERANCE;
            request.TrainingLikelihoodTolerance = likelihoodTolerance;
            request.NumberOfTrainingIterations  = numberOfIterations;

            var predictor = HiddenMarkovModelPredictorFactory.GetPredictor(predictorType);

            return(predictor.Predict(model, request));
        }
        public IEvaluationResult EvaluatePrediction(IPredictionResult results, double[][] observations)
        {
            var model = (HiddenMarkovModelWeightedMixtureDistribution)HiddenMarkovModelFactory.GetModel <HiddenMarkovModelWeightedMixtureDistribution, Mixture <IMultivariateDistribution> >(new ModelCreationParameters <Mixture <IMultivariateDistribution> > {
                Pi = _pi, TransitionProbabilityMatrix = _transitionProbabilityMatrix, Emissions = _emission
            });                                                                                                                                                                                                                                                                                                                                            //new HiddenMarkovModelState<IMultivariateDistribution>(_pi, _transitionProbabilityMatrix, _emission);

            model.Normalized = Normalized;
            var request = new EvaluationRequest();

            request.PredictionParameters           = new PredictionRequest();
            request.PredictionToEvaluate           = new PredictionResult();
            request.EstimatorType                  = ErrorEstimatorType.Value;
            request.PredictionParameters.Tolerance = PREDICTION_LIKELIHOOD_TOLERANCE;
            request.PredictionParameters.TestSet   = observations;
            request.PredictionToEvaluate.Predicted = results.Predicted;

            var predictor = new LikelihoodBasedPredictor();

            return(predictor.Evaluate(request));
        }