Ejemplo n.º 1
0
        public double EstimateBestTheta(List<QuestionInfo> questionHistory, double previousTheta)
        {
            List<IModelParameters> modelParametersList = questionHistory.Select(x => x.Question.ModelParameters).ToList();
            List<int> responseVector = questionHistory.Select(x => (int)x.Score).ToList();

            if (IsZeroVarianceReponsePattern(responseVector))
            {
                return previousTheta + ConstantStep;
            }

            MaximumLikelihoodEstimator mleEstimator = new MaximumLikelihoodEstimator(modelParametersList);
            var mleOfTheta = mleEstimator.GetMle(responseVector);

            return mleOfTheta;
        }
        public double EstimateBestTheta(List <QuestionInfo> questionHistory, double previousTheta)
        {
            List <IModelParameters> modelParametersList = GetModelParametersList(questionHistory);
            //questionHistory.Select(x => x.Question.ModelParameters).ToList();

            List <int> responseVector = questionHistory.Select(x => (int)x.Score).ToList();

            if (AllResponsesCorrect(responseVector))
            {
                return(previousTheta + GetIncreasingNonZeroVarianceStep());
            }

            if (AllResponsesIncorrect(responseVector))
            {
                return(previousTheta - GetDecreasingNonZeroVarianceStep());
            }

            MaximumLikelihoodEstimator mleEstimator = new MaximumLikelihoodEstimator(modelParametersList, _gradientDescentTolerance);
            var mleOfTheta = mleEstimator.GetMle(responseVector);

            return(mleOfTheta);
        }