Ejemplo n.º 1
0
 def test_bad_input_exception(self):
     _fit_with_constraint = HistFit(self._data_container, model_density_function=self._model_function,
                                    model_density_antiderivative=self._model_function_antiderivative)
     with self.assertRaises(HistFitException):
         _fit_with_constraint.add_parameter_constraint('c', 1.0, 1.0)
     with self.assertRaises(HistFitException):
         _fit_with_constraint.add_matrix_parameter_constraint(['a', 'c'], [1.0, 2.0], [[0.2, 0.0], [0.0, 0.1]])
     with self.assertRaises(HistFitException):
         _fit_with_constraint.add_matrix_parameter_constraint(['a'], [1.0, 2.0], [[0.2, 0.0], [0.0, 0.1]])
Ejemplo n.º 2
0
 def test_fit_profile_cov_mat_correlated(self):
     _fit_with_constraint = HistFit(
         self._data_container,
         model_density_function=self._model_function,
         bin_evaluation=self._model_function_antiderivative)
     _fit_with_constraint.add_matrix_parameter_constraint(['a', 'b'],
                                                          self._means,
                                                          self._cov_mat_cor)
     self._test_consistency(_fit_with_constraint, self._cov_mat_cor_inv)
Ejemplo n.º 3
0
 def test_fit_profile_cov_mat_uncorrelated(self):
     _fit_with_constraint = HistFit(self._data_container, model_density_function=self._model_function,
                                    model_density_antiderivative=self._model_function_antiderivative)
     _fit_with_constraint.add_matrix_parameter_constraint(['a', 'b'], self._means, self._cov_mat_uncor)
     self._test_consistency(_fit_with_constraint, self._cov_mat_uncor_inv)
     _fit_with_constraint_alt = HistFit(self._data_container, model_density_function=self._model_function,
                                        model_density_antiderivative=self._model_function_antiderivative)
     _fit_with_constraint_alt.add_parameter_constraint('a', self._means[0], np.sqrt(self._vars[0]))
     _fit_with_constraint_alt.add_parameter_constraint('b', self._means[1], np.sqrt(self._vars[1]))
     self._test_consistency(_fit_with_constraint_alt, self._cov_mat_uncor_inv)