public double GetMle(List<int> responseVector)
        {
            LogLikelihoodFunction logLikelihoodFunction = new LogLikelihoodFunction(_modelParametersList);

            const double initialGuess = 0;
            OneDimensionalFunction firstDerivativeFunction = x => logLikelihoodFunction.LogLikelihoodFirstDerivative(responseVector, x);
            OneDimensionalFunction secondDerivativeFunction = x => logLikelihoodFunction.LogLikelihoodSecondDerivative(responseVector, x);
            //NewtonRhapsonSolver rootSolver = new NewtonRhapsonSolver(firstDerivativeFunction, secondDerivativeFunction, initialGuess);
            BisectionSolver rootSolver = new BisectionSolver(firstDerivativeFunction, -5, 5);

            double mle = rootSolver.FindRoot();

            return mle;
        }
        public void LogLikelihoodSecondDerivative_MultipleResponses_MatchesFiniteDifferenceDerivative()
        {
            double alpha1 = .3;
            double delta1 = .1;
            double chi1 = .2;
            ThreeParamModelParameters modelParameters1 = new ThreeParamModelParameters(alpha1, delta1, chi1);

            double alpha2 = .5;
            double delta2 = .6;
            double chi2 = .7;
            ThreeParamModelParameters modelParameters2 = new ThreeParamModelParameters(alpha2, delta2, chi2);

            double alpha3 = .1;
            double delta3 = .2;
            double chi3 = .4;
            ThreeParamModelParameters modelParameters3 = new ThreeParamModelParameters(alpha2, delta2, chi2);

            List<IModelParameters> modelParameterList = new List<IModelParameters>();
            modelParameterList.Add(modelParameters1);
            modelParameterList.Add(modelParameters2);
            modelParameterList.Add(modelParameters3);

            LogLikelihoodFunction logLikelihoodFunction = new LogLikelihoodFunction(modelParameterList);

            double theta = .4;
            List<int> responseVector = new List<int>() { 1, 0, 1 };
            OneDimensionalFunction derivativeFunction = x => logLikelihoodFunction.LogLikelihoodFirstDerivative(responseVector, x);
            FiniteDifferencer finiteDifferencer = new FiniteDifferencer(derivativeFunction);

            double logLikelihoodDerivative = logLikelihoodFunction.LogLikelihoodSecondDerivative(responseVector, theta);
            double finiteDifferenceDerivative = finiteDifferencer.ApproximateDerivative(theta);

            Assert.AreEqual(finiteDifferenceDerivative, logLikelihoodDerivative, Tolerance);
        }