

def example2(m=100, scale=0.01, stride=2):
    upper = 6
    xs1 = np.linspace(1, upper, m)[:, np.newaxis]
    y1true = (np.sum(np.sin((xs1 ** 2)), 1)[:, np.newaxis] / xs1)
    y1 = (y1true + (0.05 * np.random.randn(m, 1)))
    ridgecoeff = 1e-10
    gp1 = GaussProcess(xs1[::stride, :], y1[::stride, :], kernel=kernel_euclid, ridgecoeff=1e-10)
    yhatr1 = gp1.predict(xs1)
    plt.figure()
    plt.plot(y1true, y1, 'bo', y1true, yhatr1, 'r.')
    plt.title('euclid kernel: true versus noisy (blue) and estimated (red) observations')
    plt.figure()
    plt.plot(y1, 'bo-', y1true, 'go-', yhatr1, 'r.-')
    plt.title(('euclid kernel: true (green), noisy (blue) and estimated (red) ' + 'observations'))
    gp2 = GaussProcess(xs1[::stride, :], y1[::stride, :], kernel=kernel_rbf, scale=scale, ridgecoeff=0.01)
    yhatr2 = gp2.predict(xs1)
    plt.figure()
    plt.plot(y1true, y1, 'bo', yhatr2, yhatr2, 'r.')
    plt.title('rbf kernel: true versus noisy (blue) and estimated (red) observations')
    plt.figure()
    plt.plot(y1, 'bo-', y1true, 'go-', yhatr2, 'r.-')
    plt.title(('rbf kernel: true (green), noisy (blue) and estimated (red) ' + 'observations'))

dataset/ETHPy150Open statsmodels/statsmodels/statsmodels/sandbox/regression/kernridgeregress_class.py example2/VarMisuse@264/384 `y1true`->`yhatr2`