In [53]:
import GPy as gp
%pylab osx


Warning: Cannot change to a different GUI toolkit: osx. Using qt instead.
Populating the interactive namespace from numpy and matplotlib

In [2]:
def gauss(x):
    return np.exp(-x**2/25)

In [63]:
train_x = np.array([np.concatenate(([-6, -4], np.linspace(-3.1, -2.9, 50), [6]))]).T
train_y = gauss(train_x)  # + 0.1 * np.random.randn(len(train_x), 1)

In [64]:
m = gp.models.GPRegression(train_x, train_y, gp.kern.rbf(1, lengthscale=5))
m['noise_variance'] = 0.001

In [65]:
m.plot()
print m


Log-likelihood: 1.699e+02

       Name        |  Value   |  Constraints  |  Ties  |  Prior  
-----------------------------------------------------------------
   rbf_variance    |  1.0000  |     (+ve)     |        |         
  rbf_lengthscale  |  5.0000  |     (+ve)     |        |         
  noise_variance   |  0.0010  |     (+ve)     |        |         


In [52]:
%magic

In [ ]: