# 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
    Dlatent = 1
    Dobs = 1
    M = 15
    # create vfe model
    model_vfe = vfe.SGPSSM(y_train, Dlatent, M, 
        lik='Gaussian', prior_mean=0, prior_var=1000, gp_emi=False, nat_param=True)
    hypers = model_vfe.init_hypers(y_train)
    model_vfe.update_hypers(hypers)
    # optimise
    # model_vfe.optimise(
    #     method='L-BFGS-B', maxiter=10000, reinit_hypers=False)
    model_vfe.optimise(
        method='adam', maxiter=10000, adam_lr=0.05, reinit_hypers=False)
    opt_hypers = model_vfe.get_hypers()
    plot_latent_kink(model_vfe, y, 'VFE_MM')


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
    # create VFE model

# 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

    Dlatent = 1
    Dobs = 1
    M = 15
    # create vfe model
    model_vfe = vfe.SGPSSM(y_train, Dlatent, M, 
        lik='Gaussian', prior_mean=0, prior_var=1000, gp_emi=False, nat_param=True)
    hypers = model_vfe.init_hypers(y_train)
    model_vfe.update_hypers(hypers)
    # optimise
    # model_vfe.optimise(
    #     method='L-BFGS-B', maxiter=10000, reinit_hypers=False)
    model_vfe.optimise(
        method='adam', maxiter=10000, adam_lr=0.05, reinit_hypers=False)
    opt_hypers = model_vfe.get_hypers()
    plot_latent_kink(model_vfe, y, 'VFE_MM')


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
    # create VFE model

    model_vfe = vfe.SGPSSM(y_train, Dlatent, M, 