# 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 vfe
from .context import config
        if xprev < 4:
            fx = xprev + 1
        else:
            fx = -4*xprev + 21

        xtrue[t] = fx
        x[t] = fx + np.sqrt(process_noise)*np.random.randn()
        xprev = x[t]
        y[t] = x[t] + np.sqrt(obs_noise)*np.random.randn()

    return xtrue, x, y


def plot_latent_kink(model, y, plot_title=''):
    # make prediction on some test inputs
    N_test = 200
    x_test = np.linspace(-4, 6, N_test) / model.emi_layer.C[0, 0]
    x_test = np.reshape(x_test, [N_test, 1])
    zu = model.dyn_layer.zu
    mu, vu = model.predict_f(zu)
    mf, vf = model.predict_f(x_test)
    my, vy = model.predict_y(x_test)
    # plot function
    fig = plt.figure()
    ax = fig.add_subplot(111)
    ax.plot(x_test[:,0], kink_true(x_test[:,0]), '-', color='k')
    ax.plot(zu, mu, 'ob')
    ax.plot(x_test[:,0], mf[:,0], '-', color='b')
    ax.fill_between(
        x_test[:,0], 

# Path: examples/context.py

# 
# Path: examples/context.py



# Path: examples/gpssm_vfe_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 vfe
from .context import config

        if xprev < 4:
            fx = xprev + 1
        else:
            fx = -4*xprev + 21

        xtrue[t] = fx
        x[t] = fx + np.sqrt(process_noise)*np.random.randn()
        xprev = x[t]
        y[t] = x[t] + np.sqrt(obs_noise)*np.random.randn()

    return xtrue, x, y


def plot_latent_kink(model, y, plot_title=''):
    # make prediction on some test inputs
    N_test = 200
    x_test = np.linspace(-4, 6, N_test) / model.emi_layer.C[0, 0]
    x_test = np.reshape(x_test, [N_test, 1])
    zu = model.dyn_layer.zu
    mu, vu = model.predict_f(zu)
    mf, vf = model.predict_f(x_test)
    my, vy = model.predict_y(x_test)
    # plot function
    fig = plt.figure()
    ax = fig.add_subplot(111)
    ax.plot(x_test[:,0], kink_true(x_test[:,0]), '-', color='k')
    ax.plot(zu, mu, 'ob')
    ax.plot(x_test[:,0], mf[:,0], '-', color='b')
    ax.fill_between(
        x_test[:,0], 

        mf[:,0] + 2*np.sqrt(vf[:,0]), 