# Path: geepee/config.py
# PROP_MC = 'MC'
# 
# PROP_MM = 'MM'


import matplotlib
import sys
import numpy as np
import scipy.stats
import matplotlib.pylab as plt
import os, sys
import geepee.aep_models as aep
import geepee.vfe_models as vfe
import geepee.ep_models as ep
import pdb
from geepee.config import PROP_MC, PROP_MM
    T_train = y_train.shape[0]
    fig = plt.figure()
    ax = fig.add_subplot(111)
    ax.plot(np.arange(T_train), y_train[:, 0], 'k+-')
    ttest = np.arange(T_train, T_train+T)
    # pdb.set_trace()
    ax.plot(ttest, my[:, 0], '-', color='b')
    ax.fill_between(
        ttest, 
        my[:, 0] + 2*np.sqrt(vy_noiseless[:, 0]),
        my[:, 0] - 2*np.sqrt(vy_noiseless[:, 0]),
        alpha=0.3, edgecolor='b', facecolor='b')
    ax.fill_between(
        ttest, 
        my[:, 0] + 2*np.sqrt(vy[:, 0]),
        my[:, 0] - 2*np.sqrt(vy[:, 0]),
        alpha=0.1, edgecolor='b', facecolor='b')
    ax.plot(ttest, y_test, 'ro')
    ax.set_xlim([T_train-5, T_train + T])
    plt.title(plot_title)
    plt.savefig('/tmp/kink_pred_MM_'+plot_title+'.pdf')
    # plt.savefig('/tmp/kink_pred_MM_'+plot_title+'.png')

def find_rank(arr):
    a = np.array(arr)
    r = np.array(a.argsort().argsort(), dtype=float)
    f = a==a
    for i in xrange(len(a)):
        if not f[i]: 
            continue

# Path: geepee/config.py
# PROP_MC = 'MC'
# 
# PROP_MM = 'MM'


# Path: exps/gpssm/kink_exp.py
import matplotlib
import sys
import numpy as np
import scipy.stats
import matplotlib.pylab as plt
import os, sys
import geepee.aep_models as aep
import geepee.vfe_models as vfe
import geepee.ep_models as ep
import pdb
from geepee.config import PROP_MC, PROP_MM

    T_train = y_train.shape[0]
    fig = plt.figure()
    ax = fig.add_subplot(111)
    ax.plot(np.arange(T_train), y_train[:, 0], 'k+-')
    ttest = np.arange(T_train, T_train+T)
    # pdb.set_trace()
    ax.plot(ttest, my[:, 0], '-', color='b')
    ax.fill_between(
        ttest, 
        my[:, 0] + 2*np.sqrt(vy_noiseless[:, 0]),
        my[:, 0] - 2*np.sqrt(vy_noiseless[:, 0]),
        alpha=0.3, edgecolor='b', facecolor='b')
    ax.fill_between(
        ttest, 
        my[:, 0] + 2*np.sqrt(vy[:, 0]),
        my[:, 0] - 2*np.sqrt(vy[:, 0]),
        alpha=0.1, edgecolor='b', facecolor='b')
    ax.plot(ttest, y_test, 'ro')
    ax.set_xlim([T_train-5, T_train + T])
    plt.title(plot_title)
    plt.savefig('/tmp/kink_pred_MM_'+plot_title+'.pdf')
    # plt.savefig('/tmp/kink_pred_MM_'+plot_title+'.png')

def find_rank(arr):
    a = np.array(arr)
    r = np.array(a.argsort().argsort(), dtype=float)
    f = a==a
    for i in xrange(len(a)):
        if not f[i]: 
            continue

        s = a == a[i]