def test_1d_2fi_cokriging(self):
        # Example from Forrester: Engineering design via surrogate modelling
        def f_expensive(x):
            return ((x*6-2)**2)*sin((x*6-2)*2)
        def f_cheap(x):
            return 0.5*((x*6-2)**2)*sin((x*6-2)*2)+(x-0.5)*10. - 5


        x = array([[[0.0], [0.4], [0.6], [1.0]],
                   [[0.1], [0.2], [0.3], [0.5], [0.7],
                    [0.8], [0.9], [0.0], [0.4], [0.6], [1.0]]])
        y = array([[f_expensive(v) for v in array(x[0]).ravel()],
                   [f_cheap(v) for v in array(x[1]).ravel()]])

        cokrig = MultiFiCoKrigingSurrogate()
        cokrig.train_multifi(x, y)

        new_x = array([0.75])
        mu, sigma = cokrig.predict(new_x)
        assert_rel_error(self, mu,  f_expensive(new_x[0]), 0.05)
        assert_rel_error(self, sigma, 0., 0.02)
dataset/ETHPy150Open OpenMDAO/OpenMDAO/openmdao/surrogate_models/test/test_multifi_cokriging.py/CoKrigingSurrogateTest.test_1d_2fi_cokriging/original