# 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
    M = 15
    alpha = 0.5
    # create AEP model
    model_aep = aep.SGPSSM(y_train, Dlatent, M, 
        lik='Gaussian', prior_mean=0, prior_var=1000, gp_emi=False)
    hypers = model_aep.init_hypers(y_train)
    model_aep.update_hypers(hypers)
    # optimise
    # model_aep.optimise(
    #     method='L-BFGS-B', alpha=alpha, maxiter=10000, reinit_hypers=False)
    model_aep.optimise(
        method='adam', alpha=alpha, maxiter=10000, adam_lr=0.01, reinit_hypers=False)
    opt_hypers = model_aep.get_hypers()
    plot_latent_kink(model_aep, y, 'AEP_MM_%.3f'%alpha)


def test_kink_linear_MC():
    # 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])

    # init hypers
    Dlatent = 1
    Dobs = 1
    M = 15
    alpha = 0.5
    # create AEP model

# 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

    M = 15
    alpha = 0.5
    # create AEP model
    model_aep = aep.SGPSSM(y_train, Dlatent, M, 
        lik='Gaussian', prior_mean=0, prior_var=1000, gp_emi=False)
    hypers = model_aep.init_hypers(y_train)
    model_aep.update_hypers(hypers)
    # optimise
    # model_aep.optimise(
    #     method='L-BFGS-B', alpha=alpha, maxiter=10000, reinit_hypers=False)
    model_aep.optimise(
        method='adam', alpha=alpha, maxiter=10000, adam_lr=0.01, reinit_hypers=False)
    opt_hypers = model_aep.get_hypers()
    plot_latent_kink(model_aep, y, 'AEP_MM_%.3f'%alpha)


def test_kink_linear_MC():
    # 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])

    # init hypers
    Dlatent = 1
    Dobs = 1
    M = 15
    alpha = 0.5
    # create AEP model

    model_aep = aep.SGPSSM(y_train, Dlatent, M, 