Exemplo n.º 1
0
    def _get_fit(self, model_function=None, cost_function=None, error=None):
        '''convenience'''
        model_function = model_function or simple_indexed_model
        # TODO: fix default
        cost_function = cost_function or IndexedCostFunction_Chi2(
            errors_to_use='covariance')
        error = error or 1.0

        _fit = IndexedFit(data=self._ref_data,
                          model_function=model_function,
                          cost_function=cost_function,
                          minimizer=self.MINIMIZER)
        _fit.add_error(err_val=error)

        return _fit
Exemplo n.º 2
0
    def _get_fit(self, errors=None):
        '''convenience'''

        errors = errors or [dict(err_val=1.0)]

        _fit = IndexedFit(
            data=self._ref_data,
            model_function=simple_indexed_model,
            cost_function=IndexedCostFunction_Chi2(errors_to_use='covariance'),
            minimizer=self.MINIMIZER)

        for _err in errors:
            _fit.add_error(**_err)

        return _fit
Exemplo n.º 3
0
    def _get_fit(self, errors=None):
        '''convenience'''

        _fit = IndexedFit(
            data=self._ref_data,
            model_function=simple_indexed_model,
            cost_function=IndexedCostFunction_Chi2(errors_to_use='covariance'),
            minimizer=self.MINIMIZER)

        if errors is None:
            _fit.add_matrix_error(err_matrix=np.eye(self._n_points),
                                  matrix_type='cov')
        else:
            for _err in errors:
                if 'err_matrix' in _err:
                    _fit.add_matrix_error(**_err)
                else:
                    _fit.add_error(**_err)

        return _fit
Exemplo n.º 4
0
    def _get_fit(self,
                 model_function=None,
                 cost_function=None,
                 errors=None,
                 dynamic_error_algorithm=None):
        '''convenience'''
        model_function = model_function or simple_indexed_model
        # TODO: fix default
        cost_function = cost_function or IndexedCostFunction_Chi2(
            errors_to_use='covariance')
        errors = errors or [dict(err_val=1.0)]
        dynamic_error_algorithm = dynamic_error_algorithm or "nonlinear"

        _fit = IndexedFit(data=self._ref_data,
                          model_function=model_function,
                          cost_function=cost_function,
                          minimizer=self.MINIMIZER,
                          dynamic_error_algorithm=dynamic_error_algorithm)
        for _err in errors:
            _fit.add_error(**_err)

        return _fit