def _max_rlf(self, lvl, initial_range, tol):
        # Initialize input
        thetaL = self.thetaL[lvl]
        thetaU = self.thetaU[lvl]
                
        def rlf_transform(x):
            return self.rlf(theta=10.**x, lvl=lvl)

        # Use specified starting point as first guess
        theta0 = self.theta0[lvl]   
        x0 = np.log10(theta0[0])

        constraints = []
        for i in range(theta0.size):
            constraints.append({'type': 'ineq', 'fun': lambda log10t,i=i:
                                log10t[i] - np.log10(thetaL[0][i])})
            constraints.append({'type': 'ineq', 'fun': lambda log10t,i=i:
                                np.log10(thetaU[0][i]) - log10t[i]})                
            
        constraints = tuple(constraints)         
        sol = minimize(rlf_transform, x0, method='COBYLA',
                       constraints=constraints,
                       options={'rhobeg': initial_range,
                                'tol': tol, 'disp': 0})  
        
        log10_optimal_x = sol['x']
        optimal_rlf_value = sol['fun']
        self._nfev += sol['nfev']
            
        optimal_theta = 10. ** log10_optimal_x
                
        res = {}
        res['theta'] = optimal_theta
        res['rlf_value'] = optimal_rlf_value
        
        return res
This function estimates the autocorrelation parameter theta
dataset/ETHPy150Open OpenMDAO/OpenMDAO-Framework/openmdao.lib/src/openmdao/lib/surrogatemodels/multifi_cokriging_surrogate.py/MultiFiCoKriging._max_rlf