code: def sparse_GP_regression_1D(num_samples=400, num_inducing=5, max_iters=100, optimize=True, plot=True, checkgrad=False):
      
      # sample inputs and outputs
      X = np.random.uniform(-3., 3., (num_samples, 1))
      Y = np.sin(X) + np.random.randn(num_samples, 1) * 0.05
      # construct kernel
      rbf = GPy.kern.RBF(1)
      # create simple GP Model
      m = GPy.models.SparseGPRegression(X, Y, kernel=rbf, num_inducing=num_inducing)
  
      if checkgrad:
          m.checkgrad()
  
      if optimize:
          m.optimize('tnc', max_iters=max_iters)
  
      if plot:
          m.plot()
  
      return m
docs: Run a 1D example of a sparse GP regression.