def predict(self, new_x):
        if self.m is None:  # untrained surrogate
            raise RuntimeError("KrigingSurrogate has not been trained, so no "
                               "prediction can be made")
        r = zeros(self.n)
        X, Y = self.X, self.Y
        thetas = 10.**self.thetas
        XX = array(X)
        new_x = array(new_x)
        for i in range(self.n):
            r[i] = sum(thetas*(XX[i] - new_x)**2.)
        r = exp(-r)

        one = ones(self.n)
        if self.R_fact is not None:
            #---CHOLESKY DECOMPOSTION ---
            #f = self.mu+dot(r,cho_solve(self.R_fact,Y-dot(one,self.mu)))
            #term1 = dot(r,cho_solve(self.R_fact,r))
            #term2 = (1.0-dot(one,cho_solve(self.R_fact,r)))**2./dot(one,cho_solve(self.R_fact,one))

            rhs = vstack([(Y-dot(one, self.mu)), r, one]).T
            R_fact = (self.R_fact[0].T, not self.R_fact[1])
            cho = cho_solve(R_fact, rhs).T

            f = self.mu + dot(r, cho[0])
            term1 = dot(r, cho[1])
            term2 = (1.0 - dot(one, cho[1]))**2./dot(one, cho[2])

        else:
            #-----LSTSQ-------
            rhs = vstack([(Y-dot(one, self.mu)), r, one]).T
            lsq = lstsq(self.R.T, rhs)[0].T

            f = self.mu + dot(r, lsq[0])
            term1 = dot(r, lsq[1])
            term2 = (1.0 - dot(one, lsq[1]))**2./dot(one, lsq[2])
            """
      #-----LSTSQ-------
      rhs = vstack([(Y-dot(one, self.mu)), r, one]).T
      lsq = lstsq(self.R.T, rhs)[0].T

      f = self.mu + dot(r, lsq[0])
      term1 = dot(r, lsq[1])
      term2 = (1.0 - dot(one, lsq[1]))**2./dot(one, lsq[2])
      """
        MSE = self.sig2*(1.0 - term1 + term2)
        RMSE = sqrt(abs(MSE))

        dist = NormalDistribution(f, RMSE)
        return dist
Only load if the uptime module is present
dataset/ETHPy150Open OpenMDAO/OpenMDAO-Framework/openmdao.lib/src/openmdao/lib/surrogatemodels/kriging_surrogate.py/KrigingSurrogate.predict--crossover with--dataset/ETHPy150Open saltstack/salt/salt/states/uptime.py/__virtual__