# Path: examples/context.py

# 
# Path: examples/context.py



import matplotlib
import numpy as np
import scipy.stats
import matplotlib.pylab as plt
import os
import sys
import pdb
from .context import aep
from .context import config
    ax.plot(model.emi_layer.C[0, 0]*x_test[:,0], my[:,0], '-', color='r')
    ax.fill_between(
        model.emi_layer.C[0, 0]*x_test[:,0], 
        my[:,0] + 2*np.sqrt(vy[:,0]), 
        my[:,0] - 2*np.sqrt(vy[:,0]), 
        alpha=0.2, edgecolor='r', facecolor='r')
    ax.plot(
        y[0:model.N-1], 
        y[1:model.N], 
        'r+', alpha=0.5)

    # mx, vx = model.get_posterior_x()
    # ax.plot(mx[0:model.N-1], mx[1:model.N], 'og', alpha=0.3)
    my, vy_noiseless, vy = model.get_posterior_y()
    ax.plot(my[0:model.N-1], my[1:model.N], 'or', alpha=0.2)
    
    ax.set_xlabel(r'$x_{t-1}$')
    ax.set_ylabel(r'$x_{t}$')
    ax.set_xlim([-4, 6])
    ax.set_ylim([-7, 7])
    plt.title(plot_title)
    plt.savefig('/tmp/kink_'+plot_title+'.pdf')


def test_kink_linear_MM():
    # generate a dataset from the kink function above
    T = 200
    process_noise = 0.2
    obs_noise = 0.1
    (xtrue, x, y) = kink(T, process_noise, obs_noise)

# Path: examples/context.py

# 
# Path: examples/context.py



# Path: examples/gpssm_aep_examples.py
import matplotlib
import numpy as np
import scipy.stats
import matplotlib.pylab as plt
import os
import sys
import pdb
from .context import aep
from .context import config

    ax.plot(model.emi_layer.C[0, 0]*x_test[:,0], my[:,0], '-', color='r')
    ax.fill_between(
        model.emi_layer.C[0, 0]*x_test[:,0], 
        my[:,0] + 2*np.sqrt(vy[:,0]), 
        my[:,0] - 2*np.sqrt(vy[:,0]), 
        alpha=0.2, edgecolor='r', facecolor='r')
    ax.plot(
        y[0:model.N-1], 
        y[1:model.N], 
        'r+', alpha=0.5)

    # mx, vx = model.get_posterior_x()
    # ax.plot(mx[0:model.N-1], mx[1:model.N], 'og', alpha=0.3)
    my, vy_noiseless, vy = model.get_posterior_y()
    ax.plot(my[0:model.N-1], my[1:model.N], 'or', alpha=0.2)
    
    ax.set_xlabel(r'$x_{t-1}$')
    ax.set_ylabel(r'$x_{t}$')
    ax.set_xlim([-4, 6])
    ax.set_ylim([-7, 7])
    plt.title(plot_title)
    plt.savefig('/tmp/kink_'+plot_title+'.pdf')


def test_kink_linear_MM():
    # generate a dataset from the kink function above
    T = 200
    process_noise = 0.2
    obs_noise = 0.1
    (xtrue, x, y) = kink(T, process_noise, obs_noise)

    y_train = np.reshape(y, [y.shape[0], 1])