From 77220b272ca2d8eaee7e1b2ac631953c0290d7c7 Mon Sep 17 00:00:00 2001 From: Zimu Zheng Date: Tue, 8 Mar 2016 18:18:48 +0800 Subject: [PATCH] add more charts --- heatmap.py | 180 +++++ plotBargraph.py | 305 ++++++-- plotLinegraph.py | 1939 +++++++++++++++++++++++++++++++++------------- plotPiechart.py | 36 +- 4 files changed, 1870 insertions(+), 590 deletions(-) create mode 100644 heatmap.py diff --git a/heatmap.py b/heatmap.py new file mode 100644 index 0000000..37207af --- /dev/null +++ b/heatmap.py @@ -0,0 +1,180 @@ +# -*- coding: utf-8 -*- +""" +Created on Mon Jan 11 21:08:05 2016 +heat map +@author: zimu +""" +#!/usr/bin/python + +import numpy as NP +from matplotlib import pyplot as PLT +from matplotlib import cm as CM +from matplotlib import axes +import random + +graph = 12 +xfontsize = 60 +yfontsize = 60 +xlabelsize = 70 +ylabelsize = 70 + +if graph == 2: +# A = [] +# for i in range(0,120,10): +# B = [] +# for j in range(0,120,10): +# if i >= 55 and i <= 65 and j >= 55 and j <= 65: +# B.append(random.uniform(50,100)) +# elif i >= 50 and i <= 70 and j>= 50 and j<= 70: +# B.append(random.uniform(40,90)) +# elif i >= 30 and i <= 90 and j>= 30 and j<= 90: +# B.append(random.uniform(30,70)) +# elif i >=35 and i <= 120 and j >= 0 and j <= 35: +# B.append(random.uniform(0,1)) +# elif i >=35 and i <= 80 and j >= 100 and j <= 120: +# B.append(random.uniform(0,1)) +# elif i >=40 and i <= 55 and j >= 20 and j <= 35: +# B.append(random.uniform(0,1)) +# else: +# B.append(random.uniform(0,50)) +# A.append(B) +# A = NP.array(A) +# +# print '[' +# for i in range(len(A)): +# print '[', +# for j in range(len(A[i])-1): +# print A[i][j], ',', +# print A[i][-1], '],' +# print ']' + + A = [ + [ 4.886152207 , 0.09112904 , 34.13062004294 , 0.73508677628 , 33.9041139311 , 0.6739927033 , 10.1955819828 , 12.4610596581 , 2.48998745035 , 6.11990123017 , 4.11601138559 , 10.85974908 ], + [ 30.0303910216 , 43.9760615589 , 20.9160197496 , 33.0402240188 , 18.6481122604 , 4.54066925472 , 32.2753393539 , 41.1437109732 , 28.0045905186 , 3.01728566776 , 16.8043971567 , 2.56180174949 ], + [ 1.8188713117 , 42.210959388 , 6.10083663941 , 35.652983153 , 49.76559751 , 0.79115838619 , 30.553505580 , 38.1642232001 , 12.1054787654 , 18.7844981762 , 49.6694186837 , 28.689049451 ], + [ 6.5357487699 , 2.3633429289 , 26.1008366394 , 4.7987968656 , 59.239584457 , 67.3728199283 , 31.893746729 , 63.1218625685 , 65.7646317593 , 42.9256509313 , 35.6681690613 , 15.5975893301 ], + [ 0.6275810754 , 0.7929827891 , 0.16296994952 , 51.050709102 , 1.258417616 , 71.2584176168 , 39.031585309 , 64.2449569421 , 30.5925591083 , 51.9539740509 , 30.337108419971 ,20.761583652042 ], + [ 0.182260554612 , 0.682380753449 , 0.550748979655 , 1.25841761685 , 1.25841761685 , 81.25841761685 , 89.2682594696 , 69.2682594696 , 69.4406841966 , 0.997600891331 , 0.111958094825 , 20.389518584336 ], + [ 0.18485097583 , 0.264808878937 , 0.181168689435 , 1.25841761685 , 1.25841761685 , 89.2682594696 , 59.4739632216 , 39.4847583057 , 0.997600891331 , 0.997600891331 , 0.997600891331 , 0.238444021441 ], + [ 0.17902145708 , 0.916915405474 , 0.908301897621 , 2.9454917257 , 65.722097677 , 79.2682594696 , 6.5667568308 , 61.5463574835 , 62.9125507968 , 46.2552274864 , 40.00539518951033 , 2.9092630839 ], + [ 0.420905051272 , 0.0841778214976 , 5.722097677 , 5.2318984729 , 68.1387884211 , 64.4315273285 , 53.0210293273 , 44.0935253468 , 0.4869551176 , 0.6338441122 , 0.361848326776 , 38.1541978839 ], + [ 0.776575393016 , 0.384508050015 , 0.807172909939 , 0.6387168173 , 9.3612279153 , 8.0935749317 , 5.9458928381 , 55.8045130834 , 3.6937191954 , 0.5932510732 , 3.2416707429 , 0.5220218088 ], + [ 0.942790853963 , 1.25841761685 , 1.25841761685 , 2.4610596581 , 3.408831197 , 1.3678685125 , 19.7024209124 , 40.8655378814 , 2.7865225418 , 1.5930806656 , 0.0458421872 , 2.9092630839 ], + [ 0.237984952357 , 0.549034066752 , 0.701942878152 , 0.810009653914 , 8.87126300045 , 41.3537251518 , 26.4223329674 , 1.25841761685 , 5.4358069067 , 1.4228268659 , 0.705556674 , 0.1541978839 ], + ] + for i in range(len(A)): + for j in range(len(A[i])): + if A[i][j] > 20: + A[i][j] += random.uniform(0,20) + A = NP.array(A) + PLT.rcParams['xtick.labelsize'] = xfontsize + PLT.rcParams['ytick.labelsize'] = yfontsize + PLT.rcParams['axes.labelsize'] = xlabelsize + # 设定一个图像,背景为白色。 + fig = PLT.figure(facecolor='w') + + #注意位置坐标,数字表示的是坐标的比例 + + ax1 = fig.add_subplot(1,1,1)#,position=[0.1,0.15,0.9,0.8] + + #注意标记旋转的角度 + #ax1.set_xticklabels(['1','2','3','4','5','6'], range(6) ) + + # select the color map + #可以有多种选择,这里我最终选择的是spectral,那个1000是热度标尺被分隔成多少块,数字越多,颜色区分越细致。 + #cmap = CM.get_cmap('RdYlBu_r', 1000) + cmap = CM.get_cmap('rainbow', 1000) + #cmap = CM.get_cmap('spectral', 1000) + + # map the colors/shades to your data + + #那个vmin和vmax是数据矩阵中的最大和最小值。这个范围要与数据的范围相协调。 + + #那个aspect参数,对确定图形在整个图中的位置和大小有关系。上面的add_subplot中的position参数的数值要想有作用,这里的这个参数一定要选auto。 + map = ax1.imshow(A, cmap=cmap,aspect='auto', vmin=0,vmax=100)#interpolation="nearest", + + #shrink是标尺缩小的比例 + cb = PLT.colorbar(mappable=map, cax=None, ax=None,shrink=1) + cb.set_label('(Correlation)') + + #PLT.xlabel('Day') + #PLT.ylabel('Zone') + + # plot it + PLT.show() +elif graph == 12: + A = NP.array([ + [ 67, 62, 62, 63, 63, 64, 63, 63, 67, 62, 63.], + [ 0.72587548, 7.00126584, 8.82087102, 0.21083533, 0.82592793, 0.60874588, 1.17813145, 0.67454572, 4.2351016, 3.55232206, 1.22902051], + [ 1.49605739, 7.34871002, 9.0231552, 0.08700412, 1.41182152, 0.4598191, 0.1447843,3.70226498, 6.72622031, 11, 2.49885935], + [ 2.27682915, 11, 7.34902066, 2.08888801, 0.83785367, 1.80160852, 0.91097824, 0.17888527, 2.17441677, 11, 1.07115995], + [ 2.46063508, 7.30527671, 4.50397287, 0.31677998, 4.84715419, 1.97564677, 0.4396841, 2.40239575, 4.44897571, 11, 0.97403097], + [ 67, 62, 62., 63., 63., 64., 63., 63., 67., 62, 63], + [ 2.54002216, 7.98706641, 1.02991828, 1.00300841, 1.1355959, 2.14294932, 1.55279219, 1.49941465, 3.35626352, 1.48425593, 0.61410459], + [ 6., 11., 11., 1.70996384, 0.71936346, 1.56209125, 0.60924335, 1.95206977, 3.28395794, 11., 1.16313659], + [ 3.07524645, 11., 2.24165346, 7.00782592, 1.42166541, 2.07058535, 1.16058695, 1.37363142, 5.5262401, 11., 2.8060768 ], + [ 2.82581864, 10.97763495, 10.94680016, 0.27599524, 2.78245679, 5.5750261, 2.22801019, 1.85592031, 3.76937565, 11., 3.04540892], + [ 2.7106877, 7.9808272, 7.37288444, 3.47081454, 4.03573704, 2.2804476, 5.87536827, 2.77708807, 0.52178295, 11., 5.42714699], + [ 2.39095465, 1.86355257, 2.21259964, 2.77043841, 2.91934986, 2.76889847, 3.62421956, 5.35745116, 9.21732869, 3.23847356, 4.58768796], + [ 1.34508155, 1.46555803, 4.92340766, 0.17854144, 1.356951, 5.54150061, 2.28382692, 5.00123298, 5.0374615, 1.10242618, 0.11897865], + #[ 6., 11., 11., 10., 10., 9., 10., 10., 6., 11., 10.], + [ 67. , 62., 62., 63., 63., 64., 63., 63., 67., 62., 63.], + #[ 6. , 11., 11., 8.05863171, 8.55264156, 7.1984929, 8.25758789, 5.70767053, 6., 11., 8.27295946], + #[ 6., 11., 11., 10., 10., 9., 10., 10., 6., 11., 10.], + [ 3.22557235, 9.07865961, 9.07072195, 3.50921517, 3.66272553, 2.60960066 , 3.33432431, 3.19620531, 1.03983997, 11., 3.2558489 ], + [ 5.52136787, 6.74696799, 8.03480631 , 3.27126737, 9.52483505, 5.59169488 , 0.1683998, 2.51220356, 5.02042134, 0.94113379, 10. ], + #[ 2.37161761, 0.03200372, 1.21009108, 0.50187535, 0.69858007, 6.66949107, 1.63407907, 0.76996492, 5.16459855, 0.06112397, 0.5364499, ], + [ 6., 11., 11., 10., 10., 5.94798176, 10. , 10., 6., 11., 10., ], + [ 2.97534457, 0.07964719, 2.68980802, 0.34792059, 5.56587517, 1.27807891, 3.69520382, 1.17652955, 4.15449428, 1.18776766, 2.10116617], + [ 4.78170828, 3.09003222, 0.76202895, 2.74409836, 1.30025564, 1.95216358, 2.88138772, 1.25835777, 5.11982539, 4.3699036 , 5.99799638], + [ 2.83643125, 2.79313116, 4.26610351, 1.06816783, 0.58328791, 0.81153398, 1.33289567, 0.54540837, 4.06838802, 4.90960881, 1.08546212], + [ 67. ,62., 62., 63., 63., 64., 63., 63., 67., 62., 63.], + ]) + A = 1.0 / A +# A = NP.array([ +# [ 33.55599858, 18.69385853, 34.75038293, 24.28170215, 9.90488184], +# [ 21.18371761, 15.58803803, 10.23890917, 32.79539847, 3.33964075], +# [ 39.57897307, 32.54815666, 11.57259118, 14.14964523, 26.28465969], +# [ 7.67130677, 28.93191491, 7.08046565, 41.73502757, 49.05285761], +# [ 47.27067454, 49.41590634, 23.48479416, 12.31035488, 38.15725413] +# ]) + + from matplotlib import pyplot as PLT + from matplotlib import cm as CM + from matplotlib import axes + + PLT.rcParams['xtick.labelsize'] = 30 + PLT.rcParams['ytick.labelsize'] = 30 + PLT.rcParams['axes.labelsize'] = 45 + # 设定一个图像,背景为白色。 + fig = PLT.figure(facecolor='w') + + #注意位置坐标,数字表示的是坐标的比例 + + ax1 = fig.add_subplot(2,1,1)#,position=[0.1,0.15,0.9,0.8] + + #注意标记旋转的角度 + #ax1.set_xticklabels(['1','2','3','4','5','6'], range(6) ) + + # select the color map + #可以有多种选择,这里我最终选择的是spectral,那个1000是热度标尺被分隔成多少块,数字越多,颜色区分越细致。 + #cmap = CM.get_cmap('RdYlBu_r', 1000) + cmap = CM.get_cmap('rainbow', 1000) + #cmap = CM.get_cmap('spectral', 1000) + + # map the colors/shades to your data + + #那个vmin和vmax是数据矩阵中的最大和最小值。这个范围要与数据的范围相协调。 + + #那个aspect参数,对确定图形在整个图中的位置和大小有关系。上面的add_subplot中的position参数的数值要想有作用,这里的这个参数一定要选auto。 + map = ax1.imshow(A, cmap=cmap,aspect='auto', vmin=0,vmax=1)#interpolation="nearest", + + #shrink是标尺缩小的比例 + cb = PLT.colorbar(mappable=map, cax=None, ax=None,shrink=1) + cb.set_label('(Contribution)') + + PLT.xlabel('Day') + PLT.ylabel('Zone') + + # plot it + PLT.show() \ No newline at end of file diff --git a/plotBargraph.py b/plotBargraph.py index f7d0f07..c4cad7a 100644 --- a/plotBargraph.py +++ b/plotBargraph.py @@ -8,7 +8,66 @@ import numpy as np import matplotlib.pyplot as plt -graph = 6 +graph = 15 +xfontsize = 60 +yfontsize = 60 +xlabelsize = 70 +ylabelsize = 70 +legendsize = 60 +if graph == 14:#Fine-grained on floors without RFE, RFE 25% - +#MSE of TPO-P without and with RFE. + n_groups = 2 + mse = (2.85442982136, 2.67743721074) + #mse = (9.22276195083, 2.67743721074) + #Total, random 10, random 30, RFE 25% +# n_groups = 4 +# mse = (2.85442982136, 2.91546933629, 2.82799128194, 2.67743721074) + fig, ax = plt.subplots() + index = np.arange(n_groups) + bar_width = 0.3 + opacity = 0.7 + rects1 = plt.bar(0.7+index, mse, bar_width,alpha=opacity, color='#87CEFA') + ax=plt.gca() + for tick in ax.xaxis.get_major_ticks(): + tick.label1.set_fontsize(xfontsize) + for tick in ax.yaxis.get_major_ticks(): + tick.label1.set_fontsize(yfontsize) + plt.xlabel('Algorithms',size=xlabelsize) + plt.ylabel('Mean MSE', size=ylabelsize) + plt.xticks(0.55+ index + bar_width, ('TPO-P \n(without RFE)','TPO-P')) + plt.xlim(0,3) + plt.ylim(2.5,3) + plt.legend(bbox_to_anchor=(1, 1), prop={'size':legendsize}) + #plt.tight_layout() + plt.show() +elif graph == 15:#overview 2a - different training time + #TFO-P: Mean MSE as a function of training length + n_groups = 6 + + mse = (10.8529139633, 4.07865387387, 3.38408769104, 3.06303387774,3.04027656595,2.74723547149) + fig, ax = plt.subplots() + index = np.arange(n_groups) + bar_width = 0.4 + + opacity = 0.7 + rects1 = plt.bar(0.7+index, mse, bar_width,alpha=opacity, color='#87CEFA') + #rects2 = plt.bar(index + 2*bar_width, corrWk, bar_width,alpha=opacity,color='w') + #rects2 = plt.bar(index + 2*bar_width, corrWk, bar_width,alpha=opacity,color='g',label='Weekends') + ax=plt.gca() + for tick in ax.xaxis.get_major_ticks(): + tick.label1.set_fontsize(xfontsize) + for tick in ax.yaxis.get_major_ticks(): + tick.label1.set_fontsize(yfontsize) + plt.xlabel('Training Length (month)',size=xlabelsize) + plt.ylabel('Mean MSE', size=ylabelsize) + plt.xticks(0.5+ index + bar_width, ('0.5','1','1.5','2','2.5','3')) + plt.xlim(0,7) + plt.ylim(0,12) + plt.legend(bbox_to_anchor=(1, 1), prop={'size':legendsize}) + #plt.tight_layout() + plt.show() + + if graph == 1: n_groups = 4 @@ -26,13 +85,14 @@ s.append(t) print 'mean t', np.mean(s) - fig, ax = plt.subplots() + fig = plt.figure(figsize=(8,6),dpi=80) + errorDis1 = plt.subplot(1,1,1) index = np.arange(n_groups) bar_width = 0.35 opacity = 0.4 - rects1 = plt.bar(index, means_occ, bar_width,alpha=opacity, color='g',label= 'LWR-OT MSE') - rects2 = plt.bar(index + bar_width, means_traf, bar_width,alpha=opacity,color='r',label='LWR-T MSE') + rects1 = plt.bar(index, means_occ, bar_width,alpha=opacity, color='b',label= 'LWR-OT MSE') + rects2 = plt.bar(index + bar_width, means_traf, bar_width,alpha=opacity,color='g',label='LWR-T MSE') ax=plt.gca() for tick in ax.xaxis.get_major_ticks(): tick.label1.set_fontsize(45) @@ -41,10 +101,11 @@ plt.xlabel('Dates',size=45) plt.ylabel('MSE', size=45) plt.xticks(index + bar_width, ('8.1', '8.7', '8.18', '8.20')) - plt.ylim(0,13) + #xlim(16,24) + ylim(0,13) plt.legend(prop={'size':45}) - plt.tight_layout() + #plt.tight_layout() plt.show() elif graph == 2:#'6.5','6.6','6.9','6.10' @@ -93,7 +154,7 @@ plt.ylim(0,14) plt.legend(bbox_to_anchor=(0.47, 1), prop={'size':40}) - plt.tight_layout() + #plt.tight_layout() plt.show() elif graph == 2.1:#'6.5', '6.25', '7.21', '8.1' n_groups = 4 @@ -138,7 +199,7 @@ #plt.ylim(0,14) plt.legend(bbox_to_anchor=(0.5, 1), prop={'size':40}) - plt.tight_layout() + #plt.tight_layout() plt.show() elif graph == 3: n_groups = 4 @@ -168,7 +229,7 @@ plt.ylim(-0,0.7) plt.legend(bbox_to_anchor=(1, 1), prop={'size':40}) - plt.tight_layout() + #plt.tight_layout() plt.show() elif graph == 4:#Monday ~ Sunday and all @@ -194,58 +255,35 @@ #plt.ylim(-0,0.7) plt.legend(bbox_to_anchor=(1, 1), prop={'size':40}) - plt.tight_layout() + #plt.tight_layout() plt.show() -elif graph == 5:#overview 2a - different training time - n_groups = 6 - - mse = (10.8529139633, 4.07865387387, 3.38408769104, 3.06303387774,3.04027656595,2.74723547149) - fig, ax = plt.subplots() - index = np.arange(n_groups) - bar_width = 0.4 - - opacity = 0.7 - rects1 = plt.bar(0.7+index, mse, bar_width,alpha=opacity, color='#87CEFA') - #rects2 = plt.bar(index + 2*bar_width, corrWk, bar_width,alpha=opacity,color='w') - #rects2 = plt.bar(index + 2*bar_width, corrWk, bar_width,alpha=opacity,color='g',label='Weekends') - ax=plt.gca() - for tick in ax.xaxis.get_major_ticks(): - tick.label1.set_fontsize(40) - for tick in ax.yaxis.get_major_ticks(): - tick.label1.set_fontsize(40) - plt.xlabel('Training Length (month)',size=50) - plt.ylabel('Mean MSE', size=50) - plt.xticks(0.5+ index + bar_width, ('0.5','1','1.5','2','2.5','3')) - plt.xlim(0,7) - plt.ylim(0,12) - plt.legend(bbox_to_anchor=(1, 1), prop={'size':50}) - plt.tight_layout() - plt.show() -elif graph == 6:#Temporary vs Permanent - 2a - different training time - n_groups = 5 - mse = (14.2177786334, 4.42757176108, 3.96293832033, 3.00336627551, 2.99212143795) - fig, ax = plt.subplots() - index = np.arange(n_groups) - bar_width = 0.4 - - opacity = 0.7 - rects1 = plt.bar(0.7+index, mse, bar_width,alpha=opacity, color='#87CEFA') - #rects2 = plt.bar(index + 2*bar_width, corrWk, bar_width,alpha=opacity,color='w') - #rects2 = plt.bar(index + 2*bar_width, corrWk, bar_width,alpha=opacity,color='g',label='Weekends') - ax=plt.gca() - for tick in ax.xaxis.get_major_ticks(): - tick.label1.set_fontsize(40) - for tick in ax.yaxis.get_major_ticks(): - tick.label1.set_fontsize(40) - plt.xlabel('Training Time (week)',size=50) - plt.ylabel('Mean MSE', size=50) - plt.xticks(0.5+ index + bar_width, ('1','2','4','6','8')) - plt.xlim(0,6) - plt.ylim(0,15.5) - plt.legend(bbox_to_anchor=(1, 1), prop={'size':50}) - plt.tight_layout() - plt.show() + +#elif graph == 6:#Temporary vs Permanent - 2a - different training time +# n_groups = 5 +# #mse = (14.2177786334, 4.42757176108, 3.96293832033, 3.00336627551, 2.99212143795) +# #mse = (11.3630137637, 8.30783926981, 7.40331461664, 6.7372113718, 4.53503860232, 4.53503860232, 4.53503860232, 4.53503860232) +# fig, ax = plt.subplots() +# index = np.arange(n_groups) +# bar_width = 0.4 +# +# opacity = 0.7 +# rects1 = plt.bar(0.7+index, mse, bar_width,alpha=opacity, color='#87CEFA') +# #rects2 = plt.bar(index + 2*bar_width, corrWk, bar_width,alpha=opacity,color='w') +# #rects2 = plt.bar(index + 2*bar_width, corrWk, bar_width,alpha=opacity,color='g',label='Weekends') +# ax=plt.gca() +# for tick in ax.xaxis.get_major_ticks(): +# tick.label1.set_fontsize(40) +# for tick in ax.yaxis.get_major_ticks(): +# tick.label1.set_fontsize(40) +# plt.xlabel('Training Length (week)',size=50) +# plt.ylabel('Mean MSE', size=50) +# plt.xticks(0.5+ index + bar_width, ('1','2','3','4','6','8','10','12')) +# plt.xlim(0,6) +# #plt.ylim(0,15.5) +# plt.legend(bbox_to_anchor=(1, 1), prop={'size':50}) +# #plt.tight_layout() +# plt.show() elif graph == 7:#Temporary vs Permanent - 3a - May vs June for July n_groups = 2 mse = (4.42760649074, 2.89195517687) @@ -268,7 +306,7 @@ plt.xlim(0,3) plt.ylim(0,5) plt.legend(bbox_to_anchor=(1, 1), prop={'size':50}) - plt.tight_layout() + #plt.tight_layout() plt.show() elif graph == 8:#Temporary vs Permanent - 3a - May vs June vs July for August n_groups = 3 @@ -292,7 +330,7 @@ plt.xlim(0,4) plt.ylim(0,7) plt.legend(bbox_to_anchor=(1, 1), prop={'size':50}) - plt.tight_layout() + #plt.tight_layout() plt.show() elif graph == 9:#TFO-TT / TF-T n_groups = 9 @@ -317,9 +355,10 @@ #plt.ylim(-0,0.7) plt.legend(bbox_to_anchor=(1, 1), prop={'size':40}) - plt.tight_layout() + #plt.tight_layout() plt.show() elif graph == 10:#Fine-grained on floors Total, RFE 25% - +#MSE of TPO-P without and with RFE. n_groups = 2 mse = (2.85442982136, 2.67743721074) @@ -346,8 +385,148 @@ plt.xlim(0,3) plt.ylim(2.5,3) plt.legend(bbox_to_anchor=(1, 1), prop={'size':50}) - plt.tight_layout() + #plt.tight_layout() + plt.show() + +elif graph == 10.2:#Fine-grained on floors Total, RFE 25% - +#MSE of TPO-T without and with RFE. + + n_groups = 2 + mse = (3.03595447335, 2.81896390127) + + #Total, random 10, random 30, RFE 25% +# n_groups = 4 +# mse = (2.85442982136, 2.91546933629, 2.82799128194, 2.67743721074) + + fig, ax = plt.subplots() + index = np.arange(n_groups) + bar_width = 0.3 + + opacity = 0.7 + rects1 = plt.bar(0.7+index, mse, bar_width,alpha=opacity, color='#87CEFA') + #rects2 = plt.bar(index + 2*bar_width, corrWk, bar_width,alpha=opacity,color='w') + #rects2 = plt.bar(index + 2*bar_width, corrWk, bar_width,alpha=opacity,color='g',label='Weekends') + ax=plt.gca() + for tick in ax.xaxis.get_major_ticks(): + tick.label1.set_fontsize(40) + for tick in ax.yaxis.get_major_ticks(): + tick.label1.set_fontsize(40) + plt.xlabel('Algorithms',size=50) + plt.ylabel('Mean MSE', size=50) + plt.xticks(0.5+ index + bar_width, ('TFO-T','TFO-T (RFE)')) + plt.xlim(0,3) + plt.ylim(2.5,3.1) + plt.legend(bbox_to_anchor=(1, 1), prop={'size':50}) + #plt.tight_layout() + plt.show() +elif graph == 10.3:#Fine-grained on time slot, lasso +#MSE of TPO-P without and with lasso. + n_groups = 2 + mse = (127.880889311, 2.81896390127) +# n_groups = 4 +# mse = (2.85442982136, 2.91546933629, 2.82799128194, 2.67743721074) + + fig, ax = plt.subplots() + index = np.arange(n_groups) + bar_width = 0.3 + + opacity = 0.7 + rects1 = plt.bar(0.7+index, mse, bar_width,alpha=opacity, color='#87CEFA') + #rects2 = plt.bar(index + 2*bar_width, corrWk, bar_width,alpha=opacity,color='w') + #rects2 = plt.bar(index + 2*bar_width, corrWk, bar_width,alpha=opacity,color='g',label='Weekends') + ax=plt.gca() + for tick in ax.xaxis.get_major_ticks(): + tick.label1.set_fontsize(40) + for tick in ax.yaxis.get_major_ticks(): + tick.label1.set_fontsize(40) + plt.xlabel('Algorithms',size=50) + plt.ylabel('Mean MSE', size=50) + plt.xticks(0.5+ index + bar_width, ('TFO-P \n(without Lasso)','TFO-P')) + plt.xlim(0,3) + plt.ylim(0,130) + plt.legend(bbox_to_anchor=(1, 1), prop={'size':50}) + #plt.tight_layout() + plt.show() +elif graph == 11:#overall - running time #Running Time of different scheme components. + n_groups = 3 + mse = (24, 432, 1) + + fig, ax = plt.subplots() + index = np.arange(n_groups) + bar_width = 0.3 + + opacity = 0.7 + rects1 = plt.bar(0.7+index, mse, bar_width,alpha=opacity, color='#87CEFA') + #rects2 = plt.bar(index + 2*bar_width, corrWk, bar_width,alpha=opacity,color='w') + #rects2 = plt.bar(index + 2*bar_width, corrWk, bar_width,alpha=opacity,color='g',label='Weekends') + ax=plt.gca() + for tick in ax.xaxis.get_major_ticks(): + tick.label1.set_fontsize(40) + for tick in ax.yaxis.get_major_ticks(): + tick.label1.set_fontsize(40) + plt.xlabel('Scheme Components',size=50) + plt.ylabel('Running Time (Minutes)', size=50) + plt.xticks(0.55+ index + bar_width, ('Feature \nSelection','Feature \nExtraction','Learning and \nForecasting')) + plt.xlim(0,3.5) + #plt.ylim(2.5,3) + plt.legend(bbox_to_anchor=(1, 1), prop={'size':50}) + #plt.tight_layout() + #plt.grid(True, which = 'major', axis = 'y', linewidth=2.5, solid_joinstyle='bevel') + plt.show() +elif graph == 12:#cut loading apart - running time #Running Time of different scheme components, a more detailed view. + n_groups = 5 + mse = (80, 1, 8, 280, 1) + + + fig, ax = plt.subplots() + index = np.arange(n_groups) + bar_width = 0.3 + + opacity = 0.7 + rects1 = plt.bar(0.7+index, mse, bar_width,alpha=opacity, color='#87CEFA') + #rects2 = plt.bar(index + 2*bar_width, corrWk, bar_width,alpha=opacity,color='w') + #rects2 = plt.bar(index + 2*bar_width, corrWk, bar_width,alpha=opacity,color='g',label='Weekends') + ax=plt.gca() + for tick in ax.xaxis.get_major_ticks(): + tick.label1.set_fontsize(40) + for tick in ax.yaxis.get_major_ticks(): + tick.label1.set_fontsize(40) + plt.xlabel('Scheme Components',size=50) + plt.ylabel('Running Time (Minutes)', size=50) + plt.xticks(0.55+ index + bar_width, ('Data \nLoading','LASSO','RFE','DTW-OT','LWR')) + #plt.xlim(0,3.5) + #plt.ylim(2.5,3) + plt.legend(bbox_to_anchor=(1, 1), prop={'size':50}) + #plt.tight_layout() + #plt.grid(True, which = 'major', axis = 'y', linewidth=2.5, solid_joinstyle='bevel') plt.show() +elif graph == 13:#|S - \tilde(S)| |S - \bar(S)| |S - S_K| + n_groups = 3 + mse = (0, 8.77439156301, 40.1666666667) + + fig, ax = plt.subplots() + index = np.arange(n_groups) + bar_width = 0.3 + + opacity = 0.7 + rects1 = plt.bar(0.7+index, mse, bar_width,alpha=opacity, color='#87CEFA') + #rects2 = plt.bar(index + 2*bar_width, corrWk, bar_width,alpha=opacity,color='w') + #rects2 = plt.bar(index + 2*bar_width, corrWk, bar_width,alpha=opacity,color='g',label='Weekends') + ax=plt.gca() + for tick in ax.xaxis.get_major_ticks(): + tick.label1.set_fontweight('bold') + tick.label1.set_fontsize(45) + for tick in ax.yaxis.get_major_ticks(): + tick.label1.set_fontsize(45) + ax.tick_params(direction='out', pad=15) + plt.xlabel('Different Measurements of $S$',size=50) + plt.ylabel('Mean Square Error', size=50) + plt.xticks(0.55+ index + bar_width, (r'$S = \widetilde{S}$',r'$S = \overline{S}$','$S = S_c$'), fontsize = 50) + plt.xlim(0,3.5) + #plt.ylim(2.5,3) + plt.legend(bbox_to_anchor=(1, 1), prop={'size':50}) + #plt.tight_layout() + #plt.grid(True, which = 'major', axis = 'y', linewidth=2.5, solid_joinstyle='bevel') #time = [1,2,3] #occ = [8.60084219559 , 0.000385731267841 , 0.648762484776] #ha = [12.6118711793, 0.0929882253731, 1.18880715534] diff --git a/plotLinegraph.py b/plotLinegraph.py index 81a7b2d..a321d64 100644 --- a/plotLinegraph.py +++ b/plotLinegraph.py @@ -7,10 +7,12 @@ import matplotlib.pyplot as plt import numpy as np -from mpl_toolkits.axes_grid1 import host_subplot import mpl_toolkits.axisartist as AA - +from mpl_toolkits.axes_grid1 import host_subplot from matplotlib import ticker +from matplotlib.ticker import MultipleLocator, FormatStrFormatter + + def AutoLocatorInit(self): ticker.MaxNLocator.__init__(self, nbins=5, steps=[1, 2, 5, 10]) @@ -82,10 +84,916 @@ def AutoLocatorInit(self): -graph =32 +graph = 35.1 +#,markeredgewidth=mewidth +xfontsize = 60 +yfontsize = 60 +xlabelsize = 70 +ylabelsize = 70 +legendsize = 60 + +xfontsize = 40 +yfontsize = 40 +xlabelsize = 50 +ylabelsize = 50 +legendsize = 50 + +lwidth = 3 +osize = 45 +starsize = 55 +psize = 55 +trisize = 45 +mewidth = 3 +gridwidth = 2 + +if graph == 1: + a = 1 +elif graph == 7:#Scatter Diagram Similar days have similar offsets + dista = [549.1383861124782, 470.30221907260636, 556.82811518580593, 578.9291477985746, 539.01012386628975, 595.97662293494932, 647.8255002053786, 636.32567958262268, 600.31789256245236, 579.97152905465293, 520.91936586275608, 532.36741830472499, 509.61731809221141, 543.13228598599835, 482.38628848698198, 418.39625345689558, 490.97428133581451, 508.03760843794726, 496.45152090973647, 550.67117148527382, 490.969608703772, 408.46366001647885, 419.83870628634878, 426.34936776364424, 396.19065970712137, 451.33479183242116, 223.02728670562266, 385.85006070116981, 397.06754957751281, 448.55421483461578, 462.29698740458781, 461.65964804620609, 481.42304136190569, 368.49902460809562, 437.69274668346816, 375.92875160187901, 41.613473658290985, 58.289382506822832, 182.94264075860571, 118.31341201586983, 120.62238400952666, 84.659285866683987, 161.86180739445524, 130.12447448405342, 115.70972031913641, 60.724906993632644, 105.34206431527599, 101.55938882187908, 68.716822512797776, 69.24719200048699, 80.058830378061486, 4.5640942735051766, 106.92630296640513, 109.54430308665764, 78.55269170562525, 38.750174579457173, 30.001672680671845, 46.230920268760855, 81.064589835957861, 85.165089884293437, 0.0, 631.27496297344453, 1609.1142572584074, 11.036498816615996, 51.586450886360765, 57.712467645085653, 151.04781757850694, 443.09350985736074, 1435.8168508147692, 170.54933410067417, 191.70364262228648, 248.71606102662884, 203.85790664008442, 209.73495291015837, 471.13230473683706, 1424.0666844036255, 220.91163957979506, 249.70258341548211, 285.31735762697747, 293.80775908119631, 276.90703765524898, 404.32982050090624, 1418.0886927119773, 240.94260113873943, 295.49657280455352, 292.02956456596411, 299.3713560242835, 236.83245816227003, 313.47600182113263] + offset = [0.26666666666666572, 0.13333333333333286, 0.13333333333333286, 0.43333333333333357, 0.19999999999999929, 0.0, 0.0, 0.0, 0.0, 0.0, 0.10000000000000142, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.00027777777777515666, 0.0, 0.19999999999999929, 0.0, 0.30000000000000071, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.81666666666666643, 0.81666666666666643, 1.5166666666666657, 0.0, 0.0, 0.0, 0.30000000000000071, 0.10000000000000142, 0.10000000000000142, 0.5, 0.0, 0.0, 0.30000000000000071, 0.39999999999999858, 0.19999999999999929, 0.39999999999999858, 0.0, 0.30000000000000071, 0.30000000000000071, 1.1999999999999993, 0.39999999999999858, 0.19999999999999929, 0.0, 0.29972222222222555, 0.10000000000000142, 0.5, 0.10000000000000142, 0.10000000000000142, 0.0, 1.6000000000000014, 0.10000000000000142, 0.0, 1.6999999999999993, 0.10000000000000142, 0.0, 1.5, 0.5, 0.19999999999999929, 0.10000000000000142, 0.60000000000000142, 0.0, 0.0, 2.0, 1.0, 0.19999999999999929, 2.0, 0.80000000000000071, 0.0, 0.0, 2.0, 0.10000000000000142, 0.10000000000000142, 0.19999999999999929, 1.8999999999999986, 0.19999999999999929, 0.00027777777777515666] + #plt.xlim(0,43) + dmax = max(dista) + dmin = min(dista) + omax = max(offset) + omin = min(offset) + dista = np.array(dista) + dista = 1 - (dmax - dista) / (dmax - dmin) + offset = np.array(offset) + offset = 1 - (omax - offset) / (omax - omin) + + plt.figure() + plt.plot(dista,offset, 'o',markersize=40,markerfacecolor='y',markeredgecolor='k') + plt.xlabel("Similarity of Days",size=xlabelsize) + plt.ylabel("Similarity of Offsets",size=ylabelsize) + plt.grid(True, linewidth = gridwidth) + ax=plt.gca() + for tick in ax.xaxis.get_major_ticks(): + tick.label1.set_fontsize(xfontsize) + for tick in ax.yaxis.get_major_ticks(): + tick.label1.set_fontsize(yfontsize) + plt.show() +elif graph == 11:#TPO-P vs TP-P 150-240 #train 3 month, predict 1 month +#TPO-P v.s. TP-P: MSE as a function of time, 16:00-24:00. + time1 =[ 15.0 , 15.1 , 15.2 , 15.3 , 15.4 , 15.5 , 15.6 , 15.7 , 15.8 , 15.9 , 16.0 , 16.1 , 16.2 , 16.3 , 16.4 , 16.5 , 16.6 , 16.7 , 16.8 , 16.9 , 17.0 , 17.1 , 17.2 , 17.3 , 17.4 , 17.5 , 17.6 , 17.7 , 17.8 , 17.9 , 18.0 , 18.1, 18.2 , 18.3 , 18.4 , 18.5 , 18.6 , 18.7 , 18.8 , 18.9 , 19.0 , 19.1 , 19.2 , 19.3 , 19.4 , 19.5 , 19.6 , 19.7 , 19.8 , 19.9 , 20.0 , 20.1 , 20.2 , 20.3 , 20.4 , 20.5 , 20.6 , 20.7 , 20.8 , 20.9, 21.0 , 21.1 , 21.2 , 21.3 , 21.4 , 21.5 , 21.6 , 21.7 , 21.8 , 21.9 , 22.0 , 22.1 , 22.2 , 22.3 , 22.4 , 22.5 , 22.6 , 22.7 , 22.8 , 22.9 , 23.0 , 23.1 , 23.2 , 23.3 , 23.4 , 23.5 , 23.6 , 23.7 , 23.8, 23.9 , 24.0] + traf1 = [ 3.96618645819 , 4.04497622846 , 3.39075473611 , 4.7234606614 , 4.164909464 , 3.74929904373 , 3.90519374081 , 4.01099285863 , 4.64369992486 , 4.57965918692 , 2.82826888741 , 5.0604905316 , 3.99257536387 , 7.18455151752 , 2.36224254873 , 4.16547682492 , 3.34751996066 , 3.58983560969 , 2.43789160656 , 2.54892943846 , 2.54892943846 , 4.86102740209 , 4.39002674918 , 3.4733625116 , 1.65661314039 , 4.30196947144 , 1.85158868053 , 3.45453815456 , 8.26514748182 , 3.39325035825 , 3.05344100669 , 4.92566172441 , 3.90778176245 , 2.98940013899 , 7.03302763038 , 4.51793391538 , 5.11233797865 , 3.58112845539 , 5.31103060742 , 5.36028896036 , 4.68315982201 , 4.68057920356 , 10.2563604348 , 7.45090549345 , 3.48067021098 , 4.95830331286 , 6.78096463283 , 5.14312042025 , 2.79491732187 , 3.85133045544 , 4.39286091368 , 4.15029338914 , 2.69199038573 , 2.6877504365 , 6.18964671317 , 3.92690164743 , 1.4216195593 , 2.32972493884 , 2.68810883884 , 3.07620211093 , 8.10307709548 , 6.24938041557 , 4.41333952399 , 5.74221501923 , 4.89501154313 , 7.2711287331 , 9.07431829147 , 4.32086457158 , 8.21095270683 , 2.74730418402 , 3.6636698868 , 4.57328849058 , 5.80687995343 , 6.95878485269 , 7.72893462061 , 7.02814142419 , 5.05219816438 , 5.44598003157 , 6.13105945609 , 4.38539146046 , 6.26051298642 , 7.82124811496 , 6.47002032166 , 10.1974933772 , 3.6415823182 , 8.26392144517 , 4.41229726097 , 3.56887666101 , 6.36807457898 , 6.53689879115 , 6.50894555372 ] + occ1 = [ 3.33126992611 , 2.15235043881 , 4.21215375236 , 2.04146402499 , 2.26508236112 , 1.75842743987 , 3.83752010319 , 1.79356812562 , 2.71647871756 , 2.98920028076 , 3.06963761795 , 3.78037524154 , 2.11330949347 , 3.62306600989 , 2.10132375418 , 2.79890211351 , 2.45220911956 , 2.0962944359 , 1.71888897623 , 2.00237892092 , 2.00237892092 , 1.75017286044 , 1.87819485903 , 2.77200592938 , 0.927552735382 , 2.16110258543 , 0.952612535679 , 1.55876494568 , 2.43936505277 , 2.74032154014 , 2.20187230613 , 2.62732676781, 1.81709347884 , 2.68646819361 , 4.87840695719 , 3.58804992604 , 1.96027598281 , 2.16400733578 , 4.55698744552 , 2.61612107743 , 4.1007299461 , 2.60197595024 , 2.42772928849 , 3.70504358394 , 2.64089183244 , 2.53083484208 , 2.69596558723 , 3.82189848477 , 2.10858933652 , 2.69381421149 , 4.48942308279 , 3.48776778082 , 1.75831208948 , 1.48030854681 , 3.2901866737 , 2.33799936521 , 1.50491990853 , 1.23953538087 , 1.19008302381 , 2.36576100342, 2.57888534853 , 2.052794471 , 2.64644323686 , 1.35534774334 , 5.6573022579 , 4.76819909982 , 1.85043233584 , 3.46190356262 , 5.28356384041 , 1.84882416982 , 3.01211103176 , 4.59728665448 , 8.01181670627 , 6.44190774176 , 7.57429158629 , 5.66900034971 , 4.30244931982 , 6.23339404063 , 6.88638460847 , 4.63713969717 , 5.75838213042 , 3.38303474858 , 4.29114582128 , 2.74825804228 , 2.33363923855 , 2.26640425042 , 4.06245325649 , 3.02492973852 , 4.13263598916, 4.06968874886 , 3.87911988994] + time = [] + traf= [] + occ = [] + for time10 in range(160,240,10): + time01 = time10 / 10.0 + for i in range(len(time1)): + if time1[i] == time01: + if time1[i] == 21: + print traf1[i], occ1[i], traf1[i]/occ1[i] + time.append(time1[i]) + traf.append(traf1[i]) + occ.append(occ1[i]) + break + time.append(time1[-1]) + traf.append(traf1[-1]) + occ.append(occ1[-1]) + print 'MEAN -occ: ',np.mean(occ) + print 'MEAN - traf:', np.mean(traf) + xlim(16,24) + ylim(0,10) + fig = plt.figure(1) + errorDis1 = plt.subplot(1,1,1) + ax=plt.gca() + for tick in ax.xaxis.get_major_ticks(): + tick.label1.set_fontsize(xfontsize) + for tick in ax.yaxis.get_major_ticks(): + tick.label1.set_fontsize(yfontsize) + errorDis1.set_xlabel('Time',size=xlabelsize) + errorDis1.set_ylabel('MSE',size=ylabelsize) + errorDis1.plot(time,occ,'ob-',label='TPO-P', linewidth=lwidth, markersize=osize,markerfacecolor='none',markeredgecolor='b',markeredgewidth=mewidth) + errorDis1.plot(time,traf,'*r--',label='TP-P', linewidth = lwidth, markersize=starsize,markerfacecolor='none',markeredgecolor='r',markeredgewidth=mewidth) + #errorDis1.legend(bbox_to_anchor=(0.30, 1), prop={'size':legendsize}) + errorDis1.legend(bbox_to_anchor=(0.4, 1), prop={'size':legendsize}) + plt.grid(True, linewidth = gridwidth) + plt.show() + +elif graph == 12:#TPO-P vs TP-P 200-220 + time1 =[ 15.0 , 15.1 , 15.2 , 15.3 , 15.4 , 15.5 , 15.6 , 15.7 , 15.8 , 15.9 , 16.0 , 16.1 , 16.2 , 16.3 , 16.4 , 16.5 , 16.6 , 16.7 , 16.8 , 16.9 , 17.0 , 17.1 , 17.2 , 17.3 , 17.4 , 17.5 , 17.6 , 17.7 , 17.8 , 17.9 , 18.0 , 18.1, 18.2 , 18.3 , 18.4 , 18.5 , 18.6 , 18.7 , 18.8 , 18.9 , 19.0 , 19.1 , 19.2 , 19.3 , 19.4 , 19.5 , 19.6 , 19.7 , 19.8 , 19.9 , 20.0 , 20.1 , 20.2 , 20.3 , 20.4 , 20.5 , 20.6 , 20.7 , 20.8 , 20.9, 21.0 , 21.1 , 21.2 , 21.3 , 21.4 , 21.5 , 21.6 , 21.7 , 21.8 , 21.9 , 22.0 , 22.1 , 22.2 , 22.3 , 22.4 , 22.5 , 22.6 , 22.7 , 22.8 , 22.9 , 23.0 , 23.1 , 23.2 , 23.3 , 23.4 , 23.5 , 23.6 , 23.7 , 23.8, 23.9 , 24.0] + #traf2 = [5.648282572 , 5.15543392949 , 5.23828111858 , 3.99522995564 , 6.40135656351 , 3.33011698012 , 3.42595792088 , 0.887920546277 , 4.9063025046 , 6.3892931963 , 4.77314847668 , 3.43746839542 , 5.67484375709 , 5.3297812159 , 4.30606192381 , 4.88982691265 , 2.7806659404 , 2.42147134238 , 1.56921401765 , 2.26569041117 , 2.05704237866 , 3.68825624997 , 2.62980613877 , 2.08601428096 , 2.15463120912 , 2.12097583292 , 4.0181020104 , 4.76136547779 , 1.51607823457 , 1.75588636357 , 3.67988553676 , 4.16254546425 , 3.89581340977 , 3.16968429168 , 4.3081855229 , 2.12780904865 , 1.02279538146 , 2.07169198145 , 3.7928610568 , 5.00395450386 , 4.65880327762 , 5.13929330473 , 3.66703817684 , 5.6542576756 , 6.3448215367 , 1.10267510654 , 1.75606711166 , 1.90362678901 , 2.37726986022 , 4.40801447609 , 10.7108819679 , 19.1123797487 , 21.9144168831 , 11.4729174715 , 26.1441100047 , 14.1112663432 , 12.2157467347 , 9.47224430272 , 7.76382406644 , 3.72067391465 , 6.27401352228 , 11.9575959907 , 27.0941596366 , 1.4149245575 , 1.08184704264 , 0.775724340466 , 0.763910275063 , 0.419415884139 , 0.428053058844 , 0.740069330471 , 2.44294731878, 4.57328849058 , 5.80687995343 , 6.95878485269 , 7.72893462061 , 7.02814142419 , 5.05219816438 , 5.44598003157 , 6.13105945609 , 4.38539146046 , 6.26051298642 , 7.82124811496 , 6.47002032166 , 10.1974933772 , 3.6415823182 , 8.26392144517 , 4.41229726097 , 3.56887666101 , 6.36807457898 , 6.53689879115 , 6.50894555372] + traf1 = [ 3.96618645819 , 4.04497622846 , 3.39075473611 , 4.7234606614 , 4.164909464 , 3.74929904373 , 3.90519374081 , 4.01099285863 , 4.64369992486 , 4.57965918692 , 2.82826888741 , 5.0604905316 , 3.99257536387 , 7.18455151752 , 2.36224254873 , 4.16547682492 , 3.34751996066 , 3.58983560969 , 2.43789160656 , 2.54892943846 , 2.54892943846 , 4.86102740209 , 4.39002674918 , 3.4733625116 , 1.65661314039 , 4.30196947144 , 1.85158868053 , 3.45453815456 , 8.26514748182 , 3.39325035825 , 3.05344100669 , 4.92566172441 , 3.90778176245 , 2.98940013899 , 7.03302763038 , 4.51793391538 , 5.11233797865 , 3.58112845539 , 5.31103060742 , 5.36028896036 , 4.68315982201 , 4.68057920356 , 10.2563604348 , 7.45090549345 , 3.48067021098 , 4.95830331286 , 6.78096463283 , 5.14312042025 , 2.79491732187 , 3.85133045544 , 4.39286091368 , 4.15029338914 , 2.69199038573 , 2.6877504365 , 6.18964671317 , 3.92690164743 , 1.4216195593 , 2.32972493884 , 2.68810883884 , 3.07620211093 , 8.10307709548 , 6.24938041557 , 4.41333952399 , 5.74221501923 , 4.89501154313 , 7.2711287331 , 9.07431829147 , 4.32086457158 , 8.21095270683 , 2.74730418402 , 3.6636698868 , 4.57328849058 , 5.80687995343 , 6.95878485269 , 7.72893462061 , 7.02814142419 , 5.05219816438 , 5.44598003157 , 6.13105945609 , 4.38539146046 , 6.26051298642 , 7.82124811496 , 6.47002032166 , 10.1974933772 , 3.6415823182 , 8.26392144517 , 4.41229726097 , 3.56887666101 , 6.36807457898 , 6.53689879115 , 6.50894555372 ] + #occ2 = [ 3.43376451284 , 2.13581708141 , 4.13807611836 , 2.0743030885 , 2.27616236115 , 1.8607885637 , 3.83699568065 , 1.79999159126 , 2.78347123675 , 2.97150955692 , 3.22515920191 , 3.77469326189 , 2.10891340907 , 3.56228204836 , 2.11759849524 , 2.86155397168 , 2.44420294786 , 2.08136370027 , 1.78131533164 , 1.75831115087 , 1.3581481954 , 1.750114629 , 1.85558526873 , 2.72589476056 , 0.978178657459 , 2.20088259943 , 1.01649730622 , 1.55876494568 , 2.46512850977 , 2.73349348778 , 2.20530283716 , 2.60485116759 , 1.81709347884 , 2.67734032855 , 4.88695604165 , 3.61947500178 , 2.06317604437 , 2.24747339295 , 4.66517200172 , 2.72909921161 , 4.07424859228 , 2.52072001884 , 2.45789059095 , 3.45650152966 , 3.28383640492 , 2.54359671034 , 2.56622425956 , 3.67248937226 , 2.2656097676 , 2.9166235183 , 4.2959598894 , 3.41415392555 , 3.10378068753 , 1.59076738622 , 3.32978753887 , 2.10842312598 , 1.97281508282 , 1.53253131361 , 1.0859348115 , 2.29921994879 , 2.84173764276 , 2.95858511647 , 2.55703502614 , 1.55138408102 , 11.8911415216 , 8.31134465283 , 5.12287932888 , 3.34617552468 , 8.79609117735 , 1.71426537655 , 2.92456086528 , 5.30314993131 , 8.23194976761 , 7.19222936391 , 7.20510601604 , 5.99792971854 , 4.32794739852 , 6.46748675904 , 6.80954443842 , 4.91883488077 , 6.31881648107 , 3.31512496675 , 4.79112079617 , 3.16999156393 , 3.54661149475 , 2.75919922857 , 3.98297779129 , 3.89795549457 , 4.02183350182 , 5.68572844005 , 8.03894474887 ] + occ1 = [ 3.33126992611 , 2.15235043881 , 4.21215375236 , 2.04146402499 , 2.26508236112 , 1.75842743987 , 3.83752010319 , 1.79356812562 , 2.71647871756 , 2.98920028076 , 3.06963761795 , 3.78037524154 , 2.11330949347 , 3.62306600989 , 2.10132375418 , 2.79890211351 , 2.45220911956 , 2.0962944359 , 1.71888897623 , 2.00237892092 , 2.00237892092 , 1.75017286044 , 1.87819485903 , 2.77200592938 , 0.927552735382 , 2.16110258543 , 0.952612535679 , 1.55876494568 , 2.43936505277 , 2.74032154014 , 2.20187230613 , 2.62732676781, 1.81709347884 , 2.68646819361 , 4.87840695719 , 3.58804992604 , 1.96027598281 , 2.16400733578 , 4.55698744552 , 2.61612107743 , 4.1007299461 , 2.60197595024 , 2.42772928849 , 3.70504358394 , 2.64089183244 , 2.53083484208 , 2.69596558723 , 3.82189848477 , 2.10858933652 , 2.69381421149 , 4.48942308279 , 3.48776778082 , 1.75831208948 , 1.48030854681 , 3.2901866737 , 2.33799936521 , 1.50491990853 , 1.23953538087 , 1.19008302381 , 2.36576100342, 2.57888534853 , 2.052794471 , 2.64644323686 , 1.35534774334 , 5.6573022579 , 4.76819909982 , 1.85043233584 , 3.46190356262 , 5.28356384041 , 1.84882416982 , 3.01211103176 , 4.59728665448 , 8.01181670627 , 6.44190774176 , 7.57429158629 , 5.66900034971 , 4.30244931982 , 6.23339404063 , 6.88638460847 , 4.63713969717 , 5.75838213042 , 3.38303474858 , 4.29114582128 , 2.74825804228 , 2.33363923855 , 2.26640425042 , 4.06245325649 , 3.02492973852 , 4.13263598916, 4.06968874886 , 3.87911988994] + + time = [] + traf= [] + occ = [] + for time10 in range(160,240,1): + time01 = time10 / 10.0 + + for i in range(len(time1)): + if time1[i] == time01: + if time1[i] == 21: + print (traf1[i]-occ1[i])/traf1[i] + time.append(time1[i]) + traf.append(traf1[i]) + occ.append(occ1[i]) + break + + time.append(time1[-1]) + traf.append(traf1[-1]) + occ.append(occ1[-1]) + print 'MEAN -occ: ',np.mean(occ) + print 'MEAN - traf:', np.mean(traf) + + xlim(20,22) + #xlim(16,24) + ylim(0,10) + fig = plt.figure(1) + errorDis1 = plt.subplot(1,1,1) + ax=plt.gca() + for tick in ax.xaxis.get_major_ticks(): + tick.label1.set_fontsize(xfontsize) + for tick in ax.yaxis.get_major_ticks(): + tick.label1.set_fontsize(yfontsize) + errorDis1.set_xlabel('Time',size=xlabelsize) + errorDis1.set_ylabel('MSE',size=ylabelsize) + errorDis1.plot(time,occ,'ob-',label='TPO-P', linewidth=lwidth, markersize=osize,markerfacecolor='none',markeredgecolor='b',markeredgewidth=mewidth) + errorDis1.plot(time,traf,'*r--',label='TP-P', linewidth = lwidth, markersize=starsize,markerfacecolor='none',markeredgecolor='r',markeredgewidth=mewidth) + errorDis1.legend(bbox_to_anchor=(0.4, 1.02), prop={'size':legendsize}) + plt.grid(True, linewidth = gridwidth) + plt.show() + +elif graph == 13:#weight of O vs T: 150-240 +#Weight of Occupancy v.s. Traffic, 20:00-22:00. + time1 =[ 15.0 , 15.1 , 15.2 , 15.3 , 15.4 , 15.5 , 15.6 , 15.7 , 15.8 , 15.9 , 16.0 , 16.1 , 16.2 , 16.3 , 16.4 , 16.5 , 16.6 , 16.7 , 16.8 , 16.9 , 17.0 , 17.1 , 17.2 , 17.3 , 17.4 , 17.5 , 17.6 , 17.7 , 17.8 , 17.9 , 18.0 , 18.1, 18.2 , 18.3 , 18.4 , 18.5 , 18.6 , 18.7 , 18.8 , 18.9 , 19.0 , 19.1 , 19.2 , 19.3 , 19.4 , 19.5 , 19.6 , 19.7 , 19.8 , 19.9 , 20.0 , 20.1 , 20.2 , 20.3 , 20.4 , 20.5 , 20.6 , 20.7 , 20.8 , 20.9, 21.0 , 21.1 , 21.2 , 21.3 , 21.4 , 21.5 , 21.6 , 21.7 , 21.8 , 21.9 , 22.0 , 22.1 , 22.2 , 22.3 , 22.4 , 22.5 , 22.6 , 22.7 , 22.8 , 22.9 , 23.0 , 23.1 , 23.2 , 23.3 , 23.4 , 23.5 , 23.6 , 23.7 , 23.8, 23.9 , 24.0] + #traf2 = [5.648282572 , 5.15543392949 , 5.23828111858 , 3.99522995564 , 6.40135656351 , 3.33011698012 , 3.42595792088 , 0.887920546277 , 4.9063025046 , 6.3892931963 , 4.77314847668 , 3.43746839542 , 5.67484375709 , 5.3297812159 , 4.30606192381 , 4.88982691265 , 2.7806659404 , 2.42147134238 , 1.56921401765 , 2.26569041117 , 2.05704237866 , 3.68825624997 , 2.62980613877 , 2.08601428096 , 2.15463120912 , 2.12097583292 , 4.0181020104 , 4.76136547779 , 1.51607823457 , 1.75588636357 , 3.67988553676 , 4.16254546425 , 3.89581340977 , 3.16968429168 , 4.3081855229 , 2.12780904865 , 1.02279538146 , 2.07169198145 , 3.7928610568 , 5.00395450386 , 4.65880327762 , 5.13929330473 , 3.66703817684 , 5.6542576756 , 6.3448215367 , 1.10267510654 , 1.75606711166 , 1.90362678901 , 2.37726986022 , 4.40801447609 , 10.7108819679 , 19.1123797487 , 21.9144168831 , 11.4729174715 , 26.1441100047 , 14.1112663432 , 12.2157467347 , 9.47224430272 , 7.76382406644 , 3.72067391465 , 6.27401352228 , 11.9575959907 , 27.0941596366 , 1.4149245575 , 1.08184704264 , 0.775724340466 , 0.763910275063 , 0.419415884139 , 0.428053058844 , 0.740069330471 , 2.44294731878, 4.57328849058 , 5.80687995343 , 6.95878485269 , 7.72893462061 , 7.02814142419 , 5.05219816438 , 5.44598003157 , 6.13105945609 , 4.38539146046 , 6.26051298642 , 7.82124811496 , 6.47002032166 , 10.1974933772 , 3.6415823182 , 8.26392144517 , 4.41229726097 , 3.56887666101 , 6.36807457898 , 6.53689879115 , 6.50894555372] + #traf1 = [ 3.96618645819 , 4.04497622846 , 3.39075473611 , 4.7234606614 , 4.164909464 , 3.74929904373 , 3.90519374081 , 4.01099285863 , 4.64369992486 , 4.57965918692 , 2.82826888741 , 5.0604905316 , 3.99257536387 , 7.18455151752 , 2.36224254873 , 4.16547682492 , 3.34751996066 , 3.58983560969 , 2.43789160656 , 2.54892943846 , 2.54892943846 , 4.86102740209 , 4.39002674918 , 3.4733625116 , 1.65661314039 , 4.30196947144 , 1.85158868053 , 3.45453815456 , 8.26514748182 , 3.39325035825 , 3.05344100669 , 4.92566172441 , 3.90778176245 , 2.98940013899 , 7.03302763038 , 4.51793391538 , 5.11233797865 , 3.58112845539 , 5.31103060742 , 5.36028896036 , 4.68315982201 , 4.68057920356 , 10.2563604348 , 7.45090549345 , 3.48067021098 , 4.95830331286 , 6.78096463283 , 5.14312042025 , 2.79491732187 , 3.85133045544 , 4.39286091368 , 4.15029338914 , 2.69199038573 , 2.6877504365 , 6.18964671317 , 3.92690164743 , 1.4216195593 , 2.32972493884 , 2.68810883884 , 3.07620211093 , 8.10307709548 , 6.24938041557 , 4.41333952399 , 5.74221501923 , 4.89501154313 , 7.2711287331 , 9.07431829147 , 4.32086457158 , 8.21095270683 , 2.74730418402 , 3.6636698868 , 4.57328849058 , 5.80687995343 , 6.95878485269 , 7.72893462061 , 7.02814142419 , 5.05219816438 , 5.44598003157 , 6.13105945609 , 4.38539146046 , 6.26051298642 , 7.82124811496 , 6.47002032166 , 10.1974933772 , 3.6415823182 , 8.26392144517 , 4.41229726097 , 3.56887666101 , 6.36807457898 , 6.53689879115 , 6.50894555372 ] + #occ2 = [ 3.43376451284 , 2.13581708141 , 4.13807611836 , 2.0743030885 , 2.27616236115 , 1.8607885637 , 3.83699568065 , 1.79999159126 , 2.78347123675 , 2.97150955692 , 3.22515920191 , 3.77469326189 , 2.10891340907 , 3.56228204836 , 2.11759849524 , 2.86155397168 , 2.44420294786 , 2.08136370027 , 1.78131533164 , 1.75831115087 , 1.3581481954 , 1.750114629 , 1.85558526873 , 2.72589476056 , 0.978178657459 , 2.20088259943 , 1.01649730622 , 1.55876494568 , 2.46512850977 , 2.73349348778 , 2.20530283716 , 2.60485116759 , 1.81709347884 , 2.67734032855 , 4.88695604165 , 3.61947500178 , 2.06317604437 , 2.24747339295 , 4.66517200172 , 2.72909921161 , 4.07424859228 , 2.52072001884 , 2.45789059095 , 3.45650152966 , 3.28383640492 , 2.54359671034 , 2.56622425956 , 3.67248937226 , 2.2656097676 , 2.9166235183 , 4.2959598894 , 3.41415392555 , 3.10378068753 , 1.59076738622 , 3.32978753887 , 2.10842312598 , 1.97281508282 , 1.53253131361 , 1.0859348115 , 2.29921994879 , 2.84173764276 , 2.95858511647 , 2.55703502614 , 1.55138408102 , 11.8911415216 , 8.31134465283 , 5.12287932888 , 3.34617552468 , 8.79609117735 , 1.71426537655 , 2.92456086528 , 5.30314993131 , 8.23194976761 , 7.19222936391 , 7.20510601604 , 5.99792971854 , 4.32794739852 , 6.46748675904 , 6.80954443842 , 4.91883488077 , 6.31881648107 , 3.31512496675 , 4.79112079617 , 3.16999156393 , 3.54661149475 , 2.75919922857 , 3.98297779129 , 3.89795549457 , 4.02183350182 , 5.68572844005 , 8.03894474887 ] + #occ1 = [ 3.33126992611 , 2.15235043881 , 4.21215375236 , 2.04146402499 , 2.26508236112 , 1.75842743987 , 3.83752010319 , 1.79356812562 , 2.71647871756 , 2.98920028076 , 3.06963761795 , 3.78037524154 , 2.11330949347 , 3.62306600989 , 2.10132375418 , 2.79890211351 , 2.45220911956 , 2.0962944359 , 1.71888897623 , 2.00237892092 , 2.00237892092 , 1.75017286044 , 1.87819485903 , 2.77200592938 , 0.927552735382 , 2.16110258543 , 0.952612535679 , 1.55876494568 , 2.43936505277 , 2.74032154014 , 2.20187230613 , 2.62732676781, 1.81709347884 , 2.68646819361 , 4.87840695719 , 3.58804992604 , 1.96027598281 , 2.16400733578 , 4.55698744552 , 2.61612107743 , 4.1007299461 , 2.60197595024 , 2.42772928849 , 3.70504358394 , 2.64089183244 , 2.53083484208 , 2.69596558723 , 3.82189848477 , 2.10858933652 , 2.69381421149 , 4.48942308279 , 3.48776778082 , 1.75831208948 , 1.48030854681 , 3.2901866737 , 2.33799936521 , 1.50491990853 , 1.23953538087 , 1.19008302381 , 2.36576100342, 2.57888534853 , 2.052794471 , 2.64644323686 , 1.35534774334 , 5.6573022579 , 4.76819909982 , 1.85043233584 , 3.46190356262 , 5.28356384041 , 1.84882416982 , 3.01211103176 , 4.59728665448 , 8.01181670627 , 6.44190774176 , 7.57429158629 , 5.66900034971 , 4.30244931982 , 6.23339404063 , 6.88638460847 , 4.63713969717 , 5.75838213042 , 3.38303474858 , 4.29114582128 , 2.74825804228 , 2.33363923855 , 2.26640425042 , 4.06245325649 , 3.02492973852 , 4.13263598916, 4.06968874886 , 3.87911988994] + #occ1 = [0.16692424373911482, 0.13704164759839338, 0.31898650830802555, 0.10452958991730418, 0.31734247022119816, 0.32618177540207616, 0.14666069277131949, 0.63816499626480339, 0.20222212595730965, 0.30745867901382179, 0.1081776386963046, 0.1081776386963046, 0.1081776386963046, 0.22744769349924376, 0.064402001317135624, 0.65630934850930966, 0.088356015730331042, 0.11858121691667395, 0.22123896282522026, 0.4172431700232126, 0.1801102608185714, 0.5357994474913671, 0.013358934515704666, 0.013358934515704666, 0.013358934515704666, 0.02928890142675656, 0.19509925496976271, 0.09149841111237525, 0.30475557707556417, 0.020628876229133036, 0.44587333627549025, 0.5169740694897037, 0.086486530428686897, 0.056413050345662519, 0.15005593904338121, 0.15005593904338121, 0.15005593904338121, 0.2178692432394603, 0.34006246238669746, 0.023801051120011213, 0.065710586334031817, 0.26957231375524304, 0.51680640464147753, 0.2108334053111165, 0.025596163398236449, 0.18088277051619972, 0.53369889128197556, 0.53369889128197556, 0.53369889128197556, 0.068350804189212966, 0.20490601178358731, 0.28010519103879217, 0.24792351261265427, 0.19471886019123119, 0.18949320889315055, 0.12231104220748805, 0.59769990043317622, 0.14143533979061235, 0.70597906595178994, 0.70597906595178994, 0.70597906595178994, 0.0612429135423945, 0.43968700066416316, 0.34686503544811798, 0.26026340253064684, 0.13582487867324738, 0.31666970783637693, 0.010776626269295798, 0.22061290038128353, 0.24352653254795392, 0.17772199265846572, 0.17772199265846572, 0.17772199265846572, 0.22171643473378519, 0.15618620512686038, 0.082508952923065398, 1.0318379800925894, 0.41999289642668192, 0.35616611242362006, 0.24795150494878584, 0.71525112321611062, 0.0191633164844968, 0.32286549211754012, 0.32286549211754012, 0.32286549211754012, 0.50552668483042484, 0.44355578395545192, 0.39068423391163876, 0.70745718260287205, 0.24367378831387293, 0.091675917698250925, 0.38021746558744762, 0.82149929593091731, 0.89141246269256569, 0.91078594774446331, 0.91078594774446331, 0.91078594774446331, 0.0045378837697872126, 0.4146017221626761] + #traf1 = [0.091365426892161275, 0.18318562132858984, 0.087518622333160337, 0.12991353273424527, 0.12333303264213957, 0.21871026881445504, 0.18199995502555133, 0.035563566181508924, 0.084652500660990601, 0.19527293859223749, 0.16598578432890765, 0.16598578432890765, 0.16598578432890765, 0.054325340968703444, 0.02209769135073289, 0.11873587140492134, 0.27913688833310613, 0.037738010724058982, 0.17872998077893681, 0.072373732452806039, 0.079229610954410765, 0.14300735540188467, 0.021276381330308951, 0.021276381330308951, 0.021276381330308951, 0.045459755357921211, 0.11834935891563431, 0.024950591197589179, 0.088386111085227814, 0.0035392195651209879, 0.11244785448112346, 0.063855721060757847, 0.074380369122522161, 0.038726148066208006, 0.11042747448848253, 0.11042747448848253, 0.11042747448848253, 0.20369622974738993, 0.15899705454493882, 0.12135197520044982, 0.10682149026144266, 0.25017538992979488, 0.3523298206509583, 0.071337499141292171, 0.015037482916069933, 0.01200362486455929, 0.13674523496742264, 0.13674523496742264, 0.13674523496742264, 0.07515299942694656, 0.26589990386792484, 0.06325581429869033, 0.015009364748792085, 0.14290339384241965, 0.065396055410470194, 0.033389564766905355, 0.014160720212584844, 0.048822701406542518, 0.17155508178326612, 0.17155508178326612, 0.17155508178326612, 0.30015628849540937, 0.016503136256720105, 0.072324402174702651, 0.028525210671920959, 0.1073225638875088, 0.17031121831163859, 0.069389657898292628, 0.029996028462573557, 0.14335754128280118, 0.13293325470109379, 0.13293325470109379, 0.13293325470109379, 0.16423584418805334, 0.060898271438304674, 0.15509548982413313, 0.012893958095829211, 0.24755290976025504, 0.19847282166752547, 0.61390048550958332, 0.23848569783394064, 0.059582229860323244, 0.0942077523412648, 0.0942077523412648, 0.0942077523412648, 0.25805369400602562, 0.16222661710713093, 0.13927239694986465, 0.12208355067051971, 0.38488546753105046, 0.0053375344925239744, 0.040468597148380747, 0.12469703225097389, 0.12481702485875984, 0.22712979159540161, 0.22712979159540161, 0.22712979159540161, 0.23363850137362199, 0.11620911544794008] + occ1 = [0.64626759301346248, 0.42795121120569218, 0.7847047534305015, 0.4458633238419431, 0.72012732307385008, 0.59861724696508289, 0.44623746029358324, 0.94721380662209509, 0.70491464630775935, 0.61157617354145921, 0.39457356310566827, 0.39457356310566827, 0.39457356310566827, 0.80720177475008459, 0.7445344524450388, 0.84680136287007735, 0.2404291749673591, 0.75858369252698776, 0.55314035342748247, 0.85218293713552729, 0.69449506389913751, 0.78932539451232664, 0.38570269071884972, 0.38570269071884972, 0.38570269071884972, 0.39183180924744454, 0.62242819501219693, 0.78573804238205847, 0.77518000825931599, 0.8535581952649145, 0.79859647754236451, 0.89006121569583962, 0.53762788162120001, 0.59295276066383029, 0.57606715532782105, 0.57606715532782105, 0.57606715532782105, 0.5168099789952586, 0.68140662756518666, 0.16397213150392423, 0.38086011384479801, 0.51865994182169817, 0.59462071606506695, 0.74718336293484133, 0.62992533823440056, 0.93776842145417216, 0.79603783579639442, 0.79603783579639442, 0.79603783579639442, 0.47629959950076328, 0.43522395316557061, 0.81577461238932047, 0.94291560302609412, 0.57673585750015022, 0.74343346476699279, 0.78555276427151866, 0.97685629743970193, 0.74338692283733754, 0.80450324101226689, 0.80450324101226689, 0.80450324101226689, 0.16946056658970773, 0.96382399591514567, 0.82746606740654827, 0.90122460038993224, 0.55861117535426397, 0.65027127518363359, 0.13442841190901594, 0.88030742319934374, 0.62945608005173703, 0.57208752843877186, 0.57208752843877186, 0.57208752843877186, 0.57446592970807742, 0.7194720119933401, 0.34725340978094243, 0.98765811819806382, 0.62915966594967832, 0.6421585116581271, 0.28769615629351253, 0.74994600966399605, 0.24335746431401045, 0.77412180332135916, 0.77412180332135916, 0.77412180332135916, 0.662047767126691, 0.73220315277800319, 0.73720038803276822, 0.85282995062970024, 0.38767035255303212, 0.94498150130738756, 0.90380333285775338, 0.86821230590634579, 0.87717634019898882, 0.80039840935220252, 0.80039840935220252, 0.80039840935220252, 0.019052618365397105, 0.78107245140087556] + traf1 = [0.35373240698653746, 0.57204878879430787, 0.21529524656949856, 0.55413667615805684, 0.27987267692614992, 0.40138275303491699, 0.55376253970641676, 0.052786193377904911, 0.29508535369224065, 0.3884238264585409, 0.60542643689433184, 0.60542643689433184, 0.60542643689433184, 0.19279822524991533, 0.25546554755496115, 0.1531986371299226, 0.75957082503264095, 0.24141630747301232, 0.44685964657251748, 0.14781706286447269, 0.30550493610086238, 0.21067460548767336, 0.61429730928115023, 0.61429730928115023, 0.61429730928115023, 0.60816819075255557, 0.37757180498780307, 0.21426195761794159, 0.22481999174068398, 0.14644180473508545, 0.20140352245763554, 0.10993878430416038, 0.46237211837879999, 0.40704723933616982, 0.42393284467217884, 0.42393284467217884, 0.42393284467217884, 0.48319002100474151, 0.31859337243481328, 0.8360278684960758, 0.61913988615520199, 0.48134005817830167, 0.40537928393493305, 0.25281663706515867, 0.3700746617655995, 0.06223157854582774, 0.20396216420360561, 0.20396216420360561, 0.20396216420360561, 0.52370040049923672, 0.56477604683442939, 0.18422538761067958, 0.057084396973905764, 0.42326414249984967, 0.25656653523300721, 0.21444723572848123, 0.023143702560298032, 0.25661307716266246, 0.19549675898773322, 0.19549675898773322, 0.19549675898773322, 0.83053943341029235, 0.036176004084854274, 0.17253393259345168, 0.098775399610067885, 0.44138882464573609, 0.34972872481636647, 0.86557158809098411, 0.11969257680065622, 0.37054391994826297, 0.42791247156122808, 0.42791247156122808, 0.42791247156122808, 0.42553407029192258, 0.28052798800665996, 0.65274659021905757, 0.012341881801936232, 0.37084033405032174, 0.3578414883418729, 0.71230384370648747, 0.25005399033600395, 0.75664253568598949, 0.22587819667864087, 0.22587819667864087, 0.22587819667864087, 0.337952232873309, 0.26779684722199687, 0.26279961196723195, 0.14717004937029973, 0.61232964744696794, 0.055018498692612508, 0.096196667142246589, 0.13178769409365418, 0.12282365980101108, 0.19960159064779756, 0.19960159064779756, 0.19960159064779756, 0.98094738163460282, 0.21892754859912433] + #occ1 = [0.16692424373911482, 0.13704164759839338, 0.31898650830802555, 0.10452958991730418, 0.31734247022119816, 0.32618177540207616, 0.14666069277131949, 0.63816499626480339, 0.20222212595730965, 0.30745867901382179, 0.1081776386963046, 0.1081776386963046, 0.1081776386963046, 0.22744769349924376, 0.064402001317135624, 0.65630934850930966, 0.088356015730331042, 0.11858121691667395, 0.22123896282522026, 0.4172431700232126, 0.1801102608185714, 0.5357994474913671, 0.013358934515704666, 0.013358934515704666, 0.013358934515704666, 0.02928890142675656, 0.19509925496976271, 0.09149841111237525, 0.30475557707556417, 0.020628876229133036, 0.44587333627549025, 0.5169740694897037, 0.086486530428686897, 0.056413050345662519, 0.15005593904338121, 0.15005593904338121, 0.15005593904338121, 0.2178692432394603, 0.34006246238669746, 0.023801051120011213, 0.065710586334031817, 0.26957231375524304, 0.51680640464147753, 0.2108334053111165, 0.025596163398236449, 0.18088277051619972, 0.53369889128197556, 0.53369889128197556, 0.53369889128197556, 0.068350804189212966, 0.20490601178358731, 0.28010519103879217, 0.24792351261265427, 0.19471886019123119, 0.18949320889315055, 0.12231104220748805, 0.59769990043317622, 0.14143533979061235, 0.70597906595178994, 0.70597906595178994, 0.70597906595178994, 0.0612429135423945, 0.43968700066416316, 0.34686503544811798, 0.26026340253064684, 0.13582487867324738, 0.31666970783637693, 0.010776626269295798, 0.22061290038128353, 0.24352653254795392, 0.17772199265846572, 0.17772199265846572, 0.17772199265846572, 0.22171643473378519, 0.15618620512686038, 0.082508952923065398, 1.0318379800925894, 0.41999289642668192, 0.35616611242362006, 0.24795150494878584, 0.71525112321611062, 0.0191633164844968, 0.32286549211754012, 0.32286549211754012, 0.32286549211754012, 0.50552668483042484, 0.44355578395545192, 0.39068423391163876, 0.70745718260287205, 0.24367378831387293, 0.091675917698250925, 0.38021746558744762, 0.82149929593091731, 0.89141246269256569, 0.91078594774446331, 0.91078594774446331, 0.91078594774446331, 0.0045378837697872126, 0.4146017221626761] + #traf1 = [0.83307575626088515, 0.86295835240160668, 0.68101349169197445, 0.89547041008269579, 0.68265752977880179, 0.67381822459792384, 0.85333930722868057, 0.36183500373519661, 0.7977778740426904, 0.69254132098617815, 0.89182236130369541, 0.89182236130369541, 0.89182236130369541, 0.77255230650075624, 0.93559799868286442, 0.34369065149069034, 0.91164398426966897, 0.881418783083326, 0.77876103717477974, 0.58275682997678735, 0.8198897391814286, 0.4642005525086329, 0.98664106548429531, 0.98664106548429531, 0.98664106548429531, 0.97071109857324345, 0.80490074503023723, 0.90850158888762478, 0.69524442292443589, 0.97937112377086699, 0.55412666372450969, 0.4830259305102963, 0.91351346957131307, 0.94358694965433743, 0.84994406095661879, 0.84994406095661879, 0.84994406095661879, 0.78213075676053967, 0.65993753761330254, 0.97619894887998881, 0.93428941366596818, 0.73042768624475696, 0.48319359535852247, 0.7891665946888835, 0.97440383660176355, 0.81911722948380028, 0.46630110871802444, 0.46630110871802444, 0.46630110871802444, 0.93164919581078709, 0.79509398821641275, 0.71989480896120783, 0.75207648738734578, 0.80528113980876881, 0.81050679110684942, 0.87768895779251199, 0.40230009956682378, 0.85856466020938771, 0.29402093404821006, 0.29402093404821006, 0.29402093404821006, 0.93875708645760547, 0.56031299933583689, 0.65313496455188202, 0.73973659746935316, 0.86417512132675256, 0.68333029216362307, 0.98922337373070424, 0.77938709961871644, 0.75647346745204613, 0.82227800734153433, 0.82227800734153433, 0.82227800734153433, 0.77828356526621478, 0.84381379487313968, 0.91749104707693463, -0.031837980092589424, 0.58000710357331808, 0.64383388757637994, 0.75204849505121418, 0.28474887678388938, 0.98083668351550324, 0.67713450788245988, 0.67713450788245988, 0.67713450788245988, 0.49447331516957516, 0.55644421604454808, 0.60931576608836124, 0.29254281739712795, 0.75632621168612713, 0.9083240823017491, 0.61978253441255238, 0.17850070406908269, 0.10858753730743431, 0.089214052255536691, 0.089214052255536691, 0.089214052255536691, 0.99546211623021275, 0.5853982778373239] + time = [] + traf= [] + occ = [] + for time10 in range(160,240,1): + time01 = time10 / 10.0 + for i in range(len(time1)): + if time1[i] == time01: + time.append(time1[i]) + traf.append(traf1[i]) + occ.append(occ1[i]) + break + time.append(time1[-1]) + traf.append(traf1[-1]) + occ.append(occ1[-1]) + print 'MEAN -occ: ',np.mean(occ) + print 'MEAN - traf:', np.mean(traf) + #fig = plt.figure(figsize=(8,6),dpi=80) + errorDis1 = plt.subplot(1,1,1) + ax=plt.gca() + for tick in ax.xaxis.get_major_ticks(): + tick.label1.set_fontsize(xfontsize) + for tick in ax.yaxis.get_major_ticks(): + tick.label1.set_fontsize(yfontsize) + errorDis1.set_xlabel('Time',size=xlabelsize) + errorDis1.set_ylabel('Weight',size=ylabelsize) + errorDis1.plot(time,occ,'ob-',label='Occupancy', linewidth=lwidth, markersize=osize,markerfacecolor='none',markeredgecolor='b',markeredgewidth=mewidth) + errorDis1.plot(time,traf,'*r--',label='Traffic', linewidth = lwidth, markersize=starsize,markerfacecolor='none',markeredgecolor='r',markeredgewidth=mewidth) + errorDis1.legend(bbox_to_anchor=(0.5, 0.6), prop={'size':legendsize}) + plt.grid(True, linewidth = gridwidth) + xlim(20, 22) + ylim(0,1) + plt.show() +elif graph == 16:#different prediction time - TPO-P vs TP-P +#TPO-P V.S. TP-P: Mean MSE on 20:00 - 22:00, as a function of prediction length. + time = [0.2, 0.4, 0.6, 0.8, 1, 2] + occ = [2.81367649395, 2.72324523499, 2.89804996496, 2.90757317685, 2.85996496, 3.11718528831] + traf = [4.72950579968, 4.76761682691, 5.080508459, 5.08152992209, 5.24693381719, 5.32249324451] + print 'MEAN - occ: ',np.mean(occ) + print 'MEAN - traf:', np.mean(traf) + ylim(0,10) + xlim(0.2,1) + fig = plt.figure(1) + errorDis1 = plt.subplot(1,1,1) + ax=plt.gca() + for tick in ax.xaxis.get_major_ticks(): + tick.label1.set_fontsize(xfontsize) + for tick in ax.yaxis.get_major_ticks(): + tick.label1.set_fontsize(yfontsize) + errorDis1.set_xlabel('Prediction Length (hour)',size=xlabelsize) + errorDis1.set_ylabel('Mean MSE',size=yfontsize) + errorDis1.plot(time,occ,'ob-',label='TPO-P', linewidth=lwidth, markersize=osize,markerfacecolor='none',markeredgecolor='b',markeredgewidth=mewidth) + errorDis1.plot(time,traf,'*r--',label='TP-P', linewidth = lwidth, markersize=starsize,markerfacecolor='none',markeredgecolor='r',markeredgewidth=mewidth) + errorDis1.legend(bbox_to_anchor=(0.4, 1), prop={'size':legendsize}) + plt.grid(True, linewidth = gridwidth) + plt.show() +elif graph == 17:#O versus T - TPO-T TP-T - 1 month training 3 month test +#TPO-T v.s. TP-T: MSE as a function of time, 16:00-24:00. +# time1 = [ 6.0 , 6.1 , 6.2 , 6.3 , 6.4 , 6.5 , 6.6 , 6.7 , 6.8 , 6.9 , 7.0 , 7.1 , 7.2 , 7.3 , 7.4 , 7.5 , 7.6 , 7.7 , 7.8 , 7.9 , 8.0 , 8.1 , 8.2 , 8.3 , 8.4 , 8.5 , 8.6 , 8.7 , 8.8 , 8.9 , 9.0 , 9.1 , 9.2 , 9.3 , 9.4 , 9.5 , 9.6 , 9.7 , 9.8 , 9.9 , 10.0 , 10.1 , 10.2 , 10.3 , 10.4 , 10.5 , 10.6 , 10.7 , 10.8 , 10.9 , 11.0 , 11.1 , 11.2 , 11.3 , 11.4 , 11.5 , 11.6 , 11.7 , 11.8 , 11.9 , 12.0 , 12.1 , 12.2 , 12.3 , 12.4 , 12.5 , 12.6 , 12.7 , 12.8 , 12.9 , 13.0 , 13.1 , 13.2 , 13.3 , 13.4 , 13.5 , 13.6 , 13.7 , 13.8 , 13.9 , 14.0 , 14.1 , 14.2 , 14.3 , 14.4 , 14.5 , 14.6 , 14.7 , 14.8 , 14.9 , 15.0 , 15.1 , 15.2 , 15.3 , 15.4 , 15.5 , 15.6 , 15.7 , 15.8 , 15.9 , 16.0 , 16.1 , 16.2 , 16.3 , 16.4 , 16.5 , 16.6 , 16.7 , 16.8 , 16.9 , 17.0 , 17.1 , 17.2 , 17.3 , 17.4 , 17.5 , 17.6 , 17.7 , 17.8 , 17.9 , 18.0 , 18.1 , 18.2 , 18.3 , 18.4 , 18.5 , 18.6 , 18.7 , 18.8 , 18.9 , 19.0 , 19.1 , 19.2 , 19.3 , 19.4 , 19.5 , 19.6 , 19.7 , 19.8 , 19.9 , 20.0 , 20.1 , 20.2 , 20.3 , 20.4 , 20.5 , 20.6 , 20.7 , 20.8 , 20.9 , 21.0 , 21.1 , 21.2 , 21.3 , 21.4 , 21.5 , 21.6 , 21.7 , 21.8 , 21.9 , 22.0 ] +# oftt1 = [ 2.24145459457 , 1.73143800808 , 0.799179426583 , 2.01173649785 , 1.81718487406 , 1.15549025585 , 2.81841446511 , 1.31058908497 , 1.10303421876 , 0.645413892646 , 2.58626674665 , 3.61801909886 , 0.952661481413 , 1.33722863725 , 2.33427913521 , 3.25891430085 , 1.58177500317 , 3.16742183238 , 3.40244886268 , 2.74782217877 , 2.02421508291 , 3.43543221065 , 2.75801727099 , 3.47512377666 , 3.21835103328 , 3.55187074828 , 2.58031331124 , 2.29762085226 , 4.06586361021 , 1.99885747247 , 3.50018608759 , 2.89382577221 , 2.87643825366 , 3.82574308484 , 2.88754786537 , 3.4611622107 , 2.38718055664 , 3.64932069411 , 3.87850569272 , 4.4113182732 , 2.60367705107 , 4.38603456884 , 3.76237502142 , 4.70449294799 , 4.48489780315 , 4.00217675235 , 3.69113872225 , 2.84381752466 , 2.64490642981 , 3.26550030106 , 3.11284322531 , 3.5278606601 , 2.73389921687 , 3.22909639958 , 9.68749273327 , 3.33794329991 , 1.82267761822 , 3.84960343354 , 3.34947114286 , 1.97525234047 , 4.80490149444 , 8.14703674908 , 2.85123026634 , 4.55860899603 , 3.8336676661 , 6.30110432527 , 5.03219707113 , 16.0849484556 , 2.45380197659 , 1.51388666902 , 1.93585020619 , 1.3686990979 , 1.79589742566 , 1.87033918163 , 2.1347025076 , 2.2107307156 , 2.00306285687 , 1.42081441613 , 2.25800807735 , 2.64485987569 , 1.57499868863 , 1.46970759794 , 2.14947144609 , 1.71494163207 , 1.42890994211 , 1.42921051412 , 2.56822992844 , 2.57491186436 , 2.24887120575 , 2.45006028512 , 2.29030145929 , 2.20357005345 , 2.37107043373 , 1.79574736231 , 2.16022404774 , 1.98744860352 , 2.76517152188 , 4.46927922498 , 2.28449240154 , 3.50934876462 , 3.43002757824 , 3.57237690717 , 3.74711858238 , 5.269319282 , 1.91724186837 , 2.37274846701 , 2.74429162252 , 4.33152677022 , 5.19693037903 , 4.14178144568 , 1.3717559139 , 5.10188377373 , 15.3319173641 , 2.72503824835 , 4.43168328127 , 2.77228298597 , 4.00000047582 , 2.78321470794 , 4.4266595246 , 12.3738675504 , 2.2362768749 , 3.53624063741 , 2.17194051215 , 1.80232955064 , 3.11447942993 , 5.58415288653 , 14.1053921526 , 8.57341416642 , 3.15187293847 , 2.76141329912 , 4.07248264248 , 1.99320484803 , 2.91473616599 , 2.20586857277 , 2.94563619851 , 5.42395269199 , 29.078302079 , 14.0218517407 , 20.5513224061 , 8.07341836515 , 6.53713071169 , 3.6100915748 , 2.98813230058 , 2.04783764553 , 2.60001717019 , 1.67795651189 , 2.92481559366 , 1.78590828584 , 0.883847519117 , 2.09792479628 , 2.77275673653 , 6.82743125648 , 2.05469069428 , 4.18963363872 , 5.88560779047 , 3.49943148138 , 2.40634975286 , 3.75794501409 , 3.99229239053 , 1.58456767841 , 3.45776889589 ] +# ftt1 = [ 3.31262327416 , 1.84214332676 , 1.11111111111 , 2.03014464168 , 1.93767258383 , 1.65447074293 , 9.03852728468 , 1.27301117686 , 1.26666666667 , 9.82712031558 , 10.434122288 , 10.373339908 , 9.46630506246 , 4.1728139382 , 5.41262327416 , 4.27879684418 , 6.29760026298 , 9.66288625904 , 11.6660420776 , 11.8333333333 , 10.6944444444 , 10.0307034845 , 3.57557527942 , 11.5675871137 , 10.4951347798 , 12.6495069034 , 8.61134122288 , 7.35282708744 , 15.2697238659 , 11.763477975 , 11.9313938199 , 5.16702827087 , 9.16988823143 , 13.1682117028 , 6.59408284024 , 11.0944444444 , 10.6555555556 , 9.95519395135 , 9.09247205786 , 6.50575279421 , 8.11604207758 , 7.55410913872 , 11.0204470743 , 9.8771860618 , 11.4343523997 , 12.8762656147 , 7.9865877712 , 9.08829717291 , 8.25016436555 , 5.91666666667 , 3.31130834977 , 9.45788954635 , 9.45358316897 , 11.9777120316 , 10.9437869822 , 12.5656147272 , 10.2722222222 , 12.8760026298 , 8.95239973702 , 10.3648915187 , 5.87370151216 , 4.64280078895 , 11.4609138725 , 12.0109467456 , 3.86985535832 , 2.52258382643 , 12.7899408284 , 12.5566732413 , 10.8793228139 , 8.65 , 3.78099934254 , 10.8026298488 , 7.08011176857 , 13.9724194609 , 8.85548980934 , 10.6792899408 , 1.92024983563 , 8.36048652202 , 10.8907626561 , 12.25539119 , 10.9333333333 , 8.59119000657 , 3.31245890861 , 6.69470742932 , 5.44224194609 , 8.9033530572 , 12.6318211703 , 8.3892504931 , 12.5443786982 , 11.1166666667 , 12.7669296515 , 5.2476660092 , 10.1997698882 , 7.16147271532 , 14.1570348455 , 12.6276134122 , 6.18612754767 , 8.52889546351 , 6.97771203156 , 5.6845496384 , 9.83563445102 , 4.45420775805 , 7.94322813938 , 11.9659763314 , 5.65262984878 , 11.1993754109 , 5.48007889546 , 3.85 , 7.94165023011 , 5.82501643655 , 13.3653188692 , 12.3447074293 , 8.30325443787 , 9.31564760026 , 1.98583168968 , 5.0335634451 , 3.27419460881 , 5.45749506903 , 9.69375410914 , 10.5053583169 , 5.52222222222 , 8.88484549638 , 4.34707429323 , 7.59566074951 , 11.1198224852 , 3.9771860618 , 14.2973701512 , 5.28652202498 , 9.70667324129 , 9.508382643 , 12.7611111111 , 8.00660749507 , 11.3608809993 , 15.2407955293 , 4.07712031558 , 11.8497370151 , 13.1331032216 , 11.6076265615 , 9.47376725838 , 5.78333333333 , 5.68783694938 , 5.93011176857 , 6.64806048652 , 5.23185404339 , 16.66617357 , 9.43609467456 , 2.10019723866 , 2.68957922419 , 4.42330703485 , 9.30023011177 , 10.2113412229 , 7.99375410914 , 8.58267587114 , 10.5413872452 , 5.42728468113 , 6.30785667324 , 8.36650230112 , 7.07001972387 , 8.60621301775 , 4.16111111111 , 5.93625904011 ] +# + time1 = [ 15.0 , 15.1 , 15.2 , 15.3 , 15.4 , 15.5 , 15.6 , 15.7 , 15.8 , 15.9 , 16.0 , 16.1 , 16.2 , 16.3 , 16.4 , 16.5 , 16.6 , 16.7 , 16.8 , 16.9 , 17.0 , 17.1 , 17.2 , 17.3 , 17.4 , 17.5 , 17.6 , 17.7 , 17.8 , 17.9 , 18.0 , 18.1 , 18.2 , 18.3 , 18.4 , 18.5 , 18.6 , 18.7 , 18.8 , 18.9 , 19.0 , 19.1 , 19.2 , 19.3 , 19.4 , 19.5 , 19.6 , 19.7 , 19.8 , 19.9 , 20.0 , 20.1 , 20.2 , 20.3 , 20.4 , 20.5 , 20.6 , 20.7 , 20.8 , 20.9 , 21.0 , 21.1 , 21.2 , 21.3 , 21.4 , 21.5 , 21.6 , 21.7 , 21.8 , 21.9 , 22.0 , 22.1 , 22.2 , 22.3 , 22.4 , 22.5 , 22.6 , 22.7 , 22.8 , 22.9 , 23.0 , 23.1 , 23.2 , 23.3 , 23.4 , 23.5 , 23.6 , 23.7 , 23.8 , 23.9 , 24.0 ] + oftt1 = [ 3.34016987043 , 2.11315860427 , 3.18601772454 , 2.27078098197 , 1.9420457237 , 1.78898985201 , 3.73454058499 , 1.68480930255 , 3.0386681039 , 2.85571865734 , 3.67601949705 , 3.79573983327 , 2.14938619725 , 3.30385990796 , 2.52350280827 , 2.78920221392 , 2.33322730245 , 1.98399477751 , 1.60538259827 , 1.6598521442 , 1.32650828772 , 1.77548607706 , 1.99973719458 , 2.6260890102 , 0.836643695985 , 3.07519345155 , 1.07249957761 , 2.00305118752 , 2.5596876696 , 3.60327651365 , 1.7923848476 , 2.93387600578 , 2.10630249637 , 2.62657712208 , 4.46121606175 , 3.67395466752 , 6.08488199517 , 2.82596124205 , 3.91241243228 , 2.41879102395 , 5.58772604829 , 5.46544361042 , 2.28721049498 , 2.77276299549 , 3.76564829102 , 2.98083742388 , 2.27925861381 , 4.62218104164 , 2.28501948578 , 3.05490472895 , 3.46676593792 , 3.92566641941 , 2.17956934145 , 1.37175933222 , 6.96433390259 , 2.01892635736 , 1.26722331867 , 2.8570576534 , 1.13259061279 , 1.95600833705 , 3.03595447335 , 2.68137884379 , 2.422802909 , 1.68415431027 , 6.4498319049 , 3.96220874586 , 4.69988034974 , 4.07102932834 , 10.7651747519 , 1.81898918617 , 4.65267675925 , 6.19047595255 , 9.03167793854 , 6.76516119096 , 9.09661653142 , 5.77479201038 , 5.02901085492 , 7.21128650775 , 9.02549607313 , 4.47327569073 , 6.31552038723 , 3.84705878877 , 4.93029548398 , 7.19598955666 , 2.89317645075 , 2.24624292048 , 19.8300025219 , 16.3631961495 , 5.65725732509 , 7.03276276214 , 7.74351929772 ] + ftt1 = [ 11.9777777778 , 5.30444444444 , 6.60555555556 , 5.95777777778 , 12.5111111111 , 9.20444444444 , 7.46666666667 , 5.53777777778 , 8.21333333333 , 6.09333333333 , 7.58333333333 , 5.55333333333 , 8.17 , 12.5644444444 , 5.17 , 12.4677777778 , 6.09444444444 , 4.99666666667 , 6.82777777778 , 5.94777777778 , 11.0944444444 , 10.26 , 5.23666666667 , 7.97 , 1.59666666667 , 7.39333333333 , 2.73333333333 , 4.52222222222 , 13.65 , 9.81888888889 , 5.72222222222 , 4.58444444444 , 4.84666666667 , 6.91111111111 , 9.93 , 4.4 , 13.1433333333 , 5.34333333333 , 9.29 , 8.00111111111 , 11.3344444444 , 8.30888888889 , 13.0066666667 , 9.40888888889 , 3.65 , 9.62 , 15.25 , 9.95666666667 , 6.53333333333 , 4.36111111111 , 6.1 , 5.91666666667 , 4.94666666667 , 3.92 , 13.6955555556 , 9.13777777778 , 1.22333333333 , 2.35555555556 , 4.62 , 7.94333333333 , 9.09333333333 , 6.67333333333 , 7.17555555556 , 8.79777777778 , 5.32111111111 , 8.37 , 9.10444444444 , 4.39333333333 , 7.40111111111 , 3.44 , 3.62333333333 , 5.64111111111 , 6.80555555556 , 8.66333333333 , 9.05111111111 , 10.2 , 5.94333333333 , 6.72888888889 , 6.26888888889 , 4.31666666667 , 9.28888888889 , 9.24 , 6.27111111111 , 12.4866666667 , 3.67666666667 , 7.58777777778 , 3.85 , 4.34666666667 , 6.28 , 6.28 , 6.28 ] + + ofpt1 = [ 3.33126992611 , 2.15235043881 , 4.21215375236 , 2.04146402499 , 2.26508236112 , 1.75842743987 , 3.83752010319 , 1.79356812562 , 2.71647871756 , 2.98920028076 , 3.06963761795 , 3.78037524154 , 2.11330949347 , 3.62306600989 , 2.10132375418 , 2.79890211351 , 2.45220911956 , 2.0962944359 , 1.71888897623 , 2.00237892092 , 2.00237892092 , 1.75017286044 , 1.87819485903 , 2.77200592938 , 0.927552735382 , 2.16110258543 , 0.952612535679 , 1.55876494568 , 2.43936505277 , 2.74032154014 , 2.20187230613 , 2.62732676781, 1.81709347884 , 2.68646819361 , 4.87840695719 , 3.58804992604 , 1.96027598281 , 2.16400733578 , 4.55698744552 , 2.61612107743 , 4.1007299461 , 2.60197595024 , 2.42772928849 , 3.70504358394 , 2.64089183244 , 2.53083484208 , 2.69596558723 , 3.82189848477 , 2.10858933652 , 2.69381421149 , 4.48942308279 , 3.48776778082 , 1.75831208948 , 1.48030854681 , 3.2901866737 , 2.33799936521 , 1.50491990853 , 1.23953538087 , 1.19008302381 , 2.36576100342, 2.57888534853 , 2.052794471 , 2.64644323686 , 1.35534774334 , 5.6573022579 , 4.76819909982 , 1.85043233584 , 3.46190356262 , 5.28356384041 , 1.84882416982 , 3.01211103176 , 4.59728665448 , 8.01181670627 , 6.44190774176 , 7.57429158629 , 5.66900034971 , 4.30244931982 , 6.23339404063 , 6.88638460847 , 4.63713969717 , 5.75838213042 , 3.38303474858 , 4.29114582128 , 2.74825804228 , 2.33363923855 , 2.26640425042 , 4.06245325649 , 3.02492973852 , 4.13263598916, 4.06968874886 , 3.87911988994] + time = [] + oftt= [] + ftt = [] + ofpt = [] + for time10 in range(160,241,10): + time01 = time10 / 10.0 + for i in range(len(time1)): + if time1[i] == time01: + print time1[i], oftt1[i], ftt1[i], ftt1[i]-oftt1[i] + time.append(time1[i]) + oftt.append(oftt1[i]) + ftt.append(ftt1[i]) + ofpt.append(ofpt1[i]) + break + oftt = [3.43002757824 , 1.3717559139 , 2.2362768749, 4.07248264248 , 6.53713071169 , 2.77275673653, 3.45776889589 , 3.33960558247 , 2.20642583678] + ftt = [ 9.83563445102 , 13.3653188692 , 5.52222222222 , 12.7611111111 , 5.68783694938 , 10.2113412229 , 5.93625904011 , 7.56084812623 , 4.42580539119 ] + print 'MEAN - oftt: ',np.mean(oftt) + print 'MEAN - ftt:', np.mean(ftt) + #print 'MEAN - ofpt: ', np.mean(ofpt) + fig = plt.figure(1) + errorDis1 = plt.subplot(1,1,1) + ax=plt.gca() + for tick in ax.xaxis.get_major_ticks(): + tick.label1.set_fontsize(xfontsize) + for tick in ax.yaxis.get_major_ticks(): + tick.label1.set_fontsize(yfontsize) + #xlim(17,19) + xlim(16,24) + ylim(0,15) + errorDis1.set_xlabel('Time',size=xlabelsize) + errorDis1.set_ylabel('MSE',size=ylabelsize) + errorDis1.plot(time,oftt,'pb-',label='TPO-T', linewidth=lwidth, markersize=psize,markerfacecolor='none',markeredgecolor='b',markeredgewidth=mewidth) + errorDis1.plot(time,ftt,'^r--',label='TP-T', linewidth = lwidth, markersize=trisize,markerfacecolor='none',markeredgecolor='r',markeredgewidth=mewidth) + errorDis1.legend(bbox_to_anchor=(1, 1.05), prop={'size':legendsize}) + plt.grid(True, linewidth = gridwidth) + plt.show() +elif graph == 18:#TP-T div TPO-T +#Top 20\% volatile cases: the Mean Ratio as a function of time. + time = [] + time = [16, 17, 18, 19, 20, 21, 22, 23, 24] + zero = [0,0,0,0,0,0,0,0,0] + #25% + ratio = [29.449440786210829, 1.966945665150265, -0.90679204545960623, 0.31649577180399935, -0.58513609309913805, 9.6470266986344786, 72.850068868677127, 2.0137292360314354, 0.40817146087171535] + #ratio = [0.9226968260940509, 2.3299636296757691, 6.1308679657051401, 3.3373095525097929, 1.8801378014210286, 5.0544597175498813, 28.451763144349881, 1.3896783132826964, 1.1369982372732155] + #print len(ha) + print 'Ratio', np.mean(ratio) + #print 'Real', np.mean(ha) + fig = plt.figure(1) + errorDis1 = plt.subplot(1,1,1) + ax=plt.gca() + for tick in ax.xaxis.get_major_ticks(): + tick.label1.set_fontsize(xfontsize) + for tick in ax.yaxis.get_major_ticks(): + tick.label1.set_fontsize(yfontsize) + errorDis1.set_xlabel('Time',size=xlabelsize) + errorDis1.set_ylabel('Mean Ratio',size=ylabelsize) + errorDis1.plot(time,zero,'r--', linewidth=lwidth, markersize=6,markerfacecolor='r',markeredgecolor='r') + errorDis1.plot(time,ratio,'pb-',label='TP-T / TPO-T', linewidth = lwidth, markersize=psize,markerfacecolor='none',markeredgecolor='b',markeredgewidth=mewidth) + ylim(-2,80) + errorDis1.legend(bbox_to_anchor=(0.5, 1), loc=0, borderaxespad=0.,prop={'size':legendsize}) + plt.grid(True, linewidth = gridwidth) + plt.show() +elif graph == 19:#TPO-T vs TP-P 150-240 #train 1 predict 1 vs train 3 predict 1 +#TPO-T v.s. TP-P: MSE as a function of time, 16:00-24:00. + time1 =[16.0 , 16.1 , 16.2 , 16.3 , 16.4 , 16.5 , 16.6 , 16.7 , 16.8 , 16.9 , 17.0 , 17.1 , 17.2 , 17.3 , 17.4 , 17.5 , 17.6 , 17.7 , 17.8 , 17.9 , 18.0, 18.1 , 18.2 , 18.3 , 18.4 , 18.5 , 18.6 , 18.7 , 18.8 , 18.9 , 19.0 , 19.1 , 19.2 , 19.3 , 19.4 , 19.5 , 19.6 , 19.7 , 19.8 , 19.9 , 20.0, 20.1 , 20.2 , 20.3 , 20.4 , 20.5 , 20.6 , 20.7 , 20.8 , 20.9 , 21.0 , 21.1 , 21.2 , 21.3 , 21.4 , 21.5 , 21.6 , 21.7 , 21.8 , 21.9 , 22.0, 22.1 , 22.2 , 22.3 , 22.4 , 22.5 , 22.6 , 22.7 , 22.8 , 22.9 , 23.0 , 23.1 , 23.2 , 23.3 , 23.4 , 23.5 , 23.6 , 23.7 , 23.8 , 23.9 , 24.0] + #traf1 = [ 3.96618645819 , 4.04497622846 , 3.39075473611 , 4.7234606614 , 4.164909464 , 3.74929904373 , 3.90519374081 , 4.01099285863 , 4.64369992486 , 4.57965918692 , 2.82826888741 , 5.0604905316 , 3.99257536387 , 7.18455151752 , 2.36224254873 , 4.16547682492 , 3.34751996066 , 3.58983560969 , 2.43789160656 , 2.54892943846 , 2.54892943846 , 4.86102740209 , 4.39002674918 , 3.4733625116 , 1.65661314039 , 4.30196947144 , 1.85158868053 , 3.45453815456 , 8.26514748182 , 3.39325035825 , 3.05344100669 , 4.92566172441 , 3.90778176245 , 2.98940013899 , 7.03302763038 , 4.51793391538 , 5.11233797865 , 3.58112845539 , 5.31103060742 , 5.36028896036 , 4.68315982201 , 4.68057920356 , 10.2563604348 , 7.45090549345 , 3.48067021098 , 4.95830331286 , 6.78096463283 , 5.14312042025 , 2.79491732187 , 3.85133045544 , 4.39286091368 , 4.15029338914 , 2.69199038573 , 2.6877504365 , 6.18964671317 , 3.92690164743 , 1.4216195593 , 2.32972493884 , 2.68810883884 , 3.07620211093 , 8.10307709548 , 6.24938041557 , 4.41333952399 , 5.74221501923 , 4.89501154313 , 7.2711287331 , 9.07431829147 , 4.32086457158 , 8.21095270683 , 2.74730418402 , 3.6636698868 , 4.57328849058 , 5.80687995343 , 6.95878485269 , 7.72893462061 , 7.02814142419 , 5.05219816438 , 5.44598003157 , 6.13105945609 , 4.38539146046 , 6.26051298642 , 7.82124811496 , 6.47002032166 , 10.1974933772 , 3.6415823182 , 8.26392144517 , 4.41229726097 , 3.56887666101 , 6.36807457898 , 6.53689879115 , 6.50894555372 ] + occ1 = [4.69668769016 , 5.22815511796 , 4.75651864455 , 7.27951179414 , 1.83936252642 , 2.92045248929 , 3.27799965301 , 5.89231086353 , 7.41883633633 , 5.29257760195 , 1.29865347968 , 7.08251471428 , 16.9714386887 , 3.68136567864 , 4.6412439188 , 3.88903306758 , 3.54682791884 , 3.73403607414 , 6.9666255785 , 20.3582630944 , 3.19957891476, 3.80543310502 , 1.93401424702 , 3.17057766458 , 3.96305911318 , 6.51887629373 , 20.4186073407 , 11.4147131854 , 3.85847773442 , 3.11570712986 , 3.50262623757 , 2.22010631502 , 2.31444421917 , 2.59850885854 , 2.68293911389 , 6.75030937958 , 43.7200549223 , 21.8209065471 , 29.7734428877 , 10.3799544067 , 7.0800434828, 4.84267494922 , 2.87969582577 , 1.73273692692 , 3.36322225073 , 1.95472294708 , 2.32214555282 , 1.50623440831 , 1.09532940564 , 1.76316748388 , 2.68600217437 , 8.51850047806 , 3.06249792008 , 3.8621030668 , 10.2604727585 , 5.18644468396 , 1.89713897743 , 3.90466259625 , 5.35529750254 , 1.55552123283 , 2.9387445849, 3.87210768706 , 6.7209386312 , 7.24779869356 , 6.87608364896 , 5.11448242313 , 4.95290896891 , 6.55150709768 , 5.4000674614 , 4.36536378271 , 4.45552987643 , 3.45963586477 , 4.39443102979 , 3.25922301023 , 1.95031262487 , 2.22012292429 , 4.23730662071 , 8.2025886652 , 10.6547490425 , 3.34325981498 , 3.56071448287 ] + #[ 3.34016987043 , 2.11315860427 , 3.18601772454 , 2.27078098197 , 1.9420457237 , 1.78898985201 , 3.73454058499 , 1.68480930255 , 3.0386681039 , 2.85571865734 , 3.67601949705 , 3.79573983327 , 2.14938619725 , 3.30385990796 , 2.52350280827 , 2.78920221392 , 2.33322730245 , 1.98399477751 , 1.60538259827 , 1.6598521442 , 1.32650828772 , 1.77548607706 , 1.99973719458 , 2.6260890102 , 0.836643695985 , 3.07519345155 , 1.07249957761 , 2.00305118752 , 2.5596876696 , 3.60327651365 , 1.7923848476 , 2.93387600578 , 2.10630249637 , 2.62657712208 , 4.46121606175 , 3.67395466752 , 6.08488199517 , 2.82596124205 , 3.91241243228 , 2.41879102395 , 5.58772604829 , 5.46544361042 , 2.28721049498 , 2.77276299549 , 3.76564829102 , 2.98083742388 , 2.27925861381 , 4.62218104164 , 2.28501948578 , 3.05490472895 , 3.46676593792 , 3.92566641941 , 2.17956934145 , 1.37175933222 , 6.96433390259 , 2.01892635736 , 1.26722331867 , 2.8570576534 , 1.13259061279 , 1.95600833705 , 3.03595447335 , 2.68137884379 , 2.422802909 , 1.68415431027 , 6.4498319049 , 3.96220874586 , 4.69988034974 , 4.07102932834 , 10.7651747519 , 1.81898918617 , 4.65267675925 , 6.19047595255 , 9.03167793854 , 6.76516119096 , 9.09661653142 , 5.77479201038 , 5.02901085492 , 7.21128650775 , 9.02549607313 , 4.47327569073 , 6.31552038723 , 3.84705878877 , 4.93029548398 , 7.19598955666 , 2.89317645075 , 2.24624292048 , 19.8300025219 , 16.3631961495 , 5.65725732509 , 7.03276276214 , 7.74351929772 ] + + time2 = [ 15.0 , 15.1 , 15.2 , 15.3 , 15.4 , 15.5 , 15.6 , 15.7 , 15.8 , 15.9 , 16.0 , 16.1 , 16.2 , 16.3 , 16.4 , 16.5 , 16.6 , 16.7 , 16.8 , 16.9 , 17.0 , 17.1 , 17.2 , 17.3 , 17.4 , 17.5 , 17.6 , 17.7 , 17.8 , 17.9 , 18.0 , 18.1, 18.2 , 18.3 , 18.4 , 18.5 , 18.6 , 18.7 , 18.8 , 18.9 , 19.0 , 19.1 , 19.2 , 19.3 , 19.4 , 19.5 , 19.6 , 19.7 , 19.8 , 19.9 , 20.0 , 20.1 , 20.2 , 20.3 , 20.4 , 20.5 , 20.6 , 20.7 , 20.8 , 20.9, 21.0 , 21.1 , 21.2 , 21.3 , 21.4 , 21.5 , 21.6 , 21.7 , 21.8 , 21.9 , 22.0 , 22.1 , 22.2 , 22.3 , 22.4 , 22.5 , 22.6 , 22.7 , 22.8 , 22.9 , 23.0 , 23.1 , 23.2 , 23.3 , 23.4 , 23.5 , 23.6 , 23.7 , 23.8, 23.9 , 24.0] + traf1 = [ 3.96618645819 , 4.04497622846 , 3.39075473611 , 4.7234606614 , 4.164909464 , 3.74929904373 , 3.90519374081 , 4.01099285863 , 4.64369992486 , 4.57965918692 , 2.82826888741 , 5.0604905316 , 3.99257536387 , 7.18455151752 , 2.36224254873 , 4.16547682492 , 3.34751996066 , 3.58983560969 , 2.43789160656 , 2.54892943846 , 2.54892943846 , 4.86102740209 , 4.39002674918 , 3.4733625116 , 1.65661314039 , 4.30196947144 , 1.85158868053 , 3.45453815456 , 8.26514748182 , 3.39325035825 , 3.05344100669 , 4.92566172441 , 3.90778176245 , 2.98940013899 , 7.03302763038 , 4.51793391538 , 5.11233797865 , 3.58112845539 , 5.31103060742 , 5.36028896036 , 4.68315982201 , 4.68057920356 , 10.2563604348 , 7.45090549345 , 3.48067021098 , 4.95830331286 , 6.78096463283 , 5.14312042025 , 2.79491732187 , 3.85133045544 , 4.39286091368 , 4.15029338914 , 2.69199038573 , 2.6877504365 , 6.18964671317 , 3.92690164743 , 1.4216195593 , 2.32972493884 , 2.68810883884 , 3.07620211093 , 8.10307709548 , 6.24938041557 , 4.41333952399 , 5.74221501923 , 4.89501154313 , 7.2711287331 , 9.07431829147 , 4.32086457158 , 8.21095270683 , 2.74730418402 , 3.6636698868 , 4.57328849058 , 5.80687995343 , 6.95878485269 , 7.72893462061 , 7.02814142419 , 5.05219816438 , 5.44598003157 , 6.13105945609 , 4.38539146046 , 6.26051298642 , 7.82124811496 , 6.47002032166 , 10.1974933772 , 3.6415823182 , 8.26392144517 , 4.41229726097 , 3.56887666101 , 6.36807457898 , 6.53689879115 , 6.50894555372 ] + time = [] + occ= [] + traf = [] + for time10 in range(160,241,10): + time01 = time10 / 10.0 + for i in range(len(time1)): + if time1[i] == time01: + time.append(time1[i]) + occ.append(occ1[i]) + break + for j in range(len(time2)): + if time2[j] == time01: + traf.append(traf1[j]) + print traf1[j] + break + + time.append(time1[-1]) + traf.append(traf1[-1]) + occ.append(occ1[-1]) + print 'MEAN -occ: ',np.mean(occ) + print 'MEAN - traf:', np.mean(traf) + + fig = plt.figure(figsize=(8,6),dpi=80) + errorDis1 = plt.subplot(1,1,1) + ax=plt.gca() + for tick in ax.xaxis.get_major_ticks(): + tick.label1.set_fontsize(xfontsize) + for tick in ax.yaxis.get_major_ticks(): + tick.label1.set_fontsize(yfontsize) + errorDis1.set_xlabel('Time',size=xlabelsize) + errorDis1.set_ylabel('MSE',size=ylabelsize) + errorDis1.plot(time,occ,'pb-',label='TPO-T', linewidth=lwidth, markersize=psize,markerfacecolor='none',markeredgecolor='b',markeredgewidth=mewidth) + errorDis1.plot(time,traf,'*r--',label='TP-P', linewidth = lwidth, markersize=starsize,markerfacecolor='none',markeredgecolor='r',markeredgewidth=mewidth) + errorDis1.legend(bbox_to_anchor=(0.4, 1), prop={'size':legendsize}) + plt.grid(True, linewidth = gridwidth) + #xlim(20,22) + xlim(16,24) + ylim(0,10) + plt.show() +elif graph == 20:#O versus T - TPO-T VS TPO-P +# time1 = [ 6.0 , 6.1 , 6.2 , 6.3 , 6.4 , 6.5 , 6.6 , 6.7 , 6.8 , 6.9 , 7.0 , 7.1 , 7.2 , 7.3 , 7.4 , 7.5 , 7.6 , 7.7 , 7.8 , 7.9 , 8.0 , 8.1 , 8.2 , 8.3 , 8.4 , 8.5 , 8.6 , 8.7 , 8.8 , 8.9 , 9.0 , 9.1 , 9.2 , 9.3 , 9.4 , 9.5 , 9.6 , 9.7 , 9.8 , 9.9 , 10.0 , 10.1 , 10.2 , 10.3 , 10.4 , 10.5 , 10.6 , 10.7 , 10.8 , 10.9 , 11.0 , 11.1 , 11.2 , 11.3 , 11.4 , 11.5 , 11.6 , 11.7 , 11.8 , 11.9 , 12.0 , 12.1 , 12.2 , 12.3 , 12.4 , 12.5 , 12.6 , 12.7 , 12.8 , 12.9 , 13.0 , 13.1 , 13.2 , 13.3 , 13.4 , 13.5 , 13.6 , 13.7 , 13.8 , 13.9 , 14.0 , 14.1 , 14.2 , 14.3 , 14.4 , 14.5 , 14.6 , 14.7 , 14.8 , 14.9 , 15.0 , 15.1 , 15.2 , 15.3 , 15.4 , 15.5 , 15.6 , 15.7 , 15.8 , 15.9 , 16.0 , 16.1 , 16.2 , 16.3 , 16.4 , 16.5 , 16.6 , 16.7 , 16.8 , 16.9 , 17.0 , 17.1 , 17.2 , 17.3 , 17.4 , 17.5 , 17.6 , 17.7 , 17.8 , 17.9 , 18.0 , 18.1 , 18.2 , 18.3 , 18.4 , 18.5 , 18.6 , 18.7 , 18.8 , 18.9 , 19.0 , 19.1 , 19.2 , 19.3 , 19.4 , 19.5 , 19.6 , 19.7 , 19.8 , 19.9 , 20.0 , 20.1 , 20.2 , 20.3 , 20.4 , 20.5 , 20.6 , 20.7 , 20.8 , 20.9 , 21.0 , 21.1 , 21.2 , 21.3 , 21.4 , 21.5 , 21.6 , 21.7 , 21.8 , 21.9 , 22.0 ] +# oftt1 = [ 2.24145459457 , 1.73143800808 , 0.799179426583 , 2.01173649785 , 1.81718487406 , 1.15549025585 , 2.81841446511 , 1.31058908497 , 1.10303421876 , 0.645413892646 , 2.58626674665 , 3.61801909886 , 0.952661481413 , 1.33722863725 , 2.33427913521 , 3.25891430085 , 1.58177500317 , 3.16742183238 , 3.40244886268 , 2.74782217877 , 2.02421508291 , 3.43543221065 , 2.75801727099 , 3.47512377666 , 3.21835103328 , 3.55187074828 , 2.58031331124 , 2.29762085226 , 4.06586361021 , 1.99885747247 , 3.50018608759 , 2.89382577221 , 2.87643825366 , 3.82574308484 , 2.88754786537 , 3.4611622107 , 2.38718055664 , 3.64932069411 , 3.87850569272 , 4.4113182732 , 2.60367705107 , 4.38603456884 , 3.76237502142 , 4.70449294799 , 4.48489780315 , 4.00217675235 , 3.69113872225 , 2.84381752466 , 2.64490642981 , 3.26550030106 , 3.11284322531 , 3.5278606601 , 2.73389921687 , 3.22909639958 , 9.68749273327 , 3.33794329991 , 1.82267761822 , 3.84960343354 , 3.34947114286 , 1.97525234047 , 4.80490149444 , 8.14703674908 , 2.85123026634 , 4.55860899603 , 3.8336676661 , 6.30110432527 , 5.03219707113 , 16.0849484556 , 2.45380197659 , 1.51388666902 , 1.93585020619 , 1.3686990979 , 1.79589742566 , 1.87033918163 , 2.1347025076 , 2.2107307156 , 2.00306285687 , 1.42081441613 , 2.25800807735 , 2.64485987569 , 1.57499868863 , 1.46970759794 , 2.14947144609 , 1.71494163207 , 1.42890994211 , 1.42921051412 , 2.56822992844 , 2.57491186436 , 2.24887120575 , 2.45006028512 , 2.29030145929 , 2.20357005345 , 2.37107043373 , 1.79574736231 , 2.16022404774 , 1.98744860352 , 2.76517152188 , 4.46927922498 , 2.28449240154 , 3.50934876462 , 3.43002757824 , 3.57237690717 , 3.74711858238 , 5.269319282 , 1.91724186837 , 2.37274846701 , 2.74429162252 , 4.33152677022 , 5.19693037903 , 4.14178144568 , 1.3717559139 , 5.10188377373 , 15.3319173641 , 2.72503824835 , 4.43168328127 , 2.77228298597 , 4.00000047582 , 2.78321470794 , 4.4266595246 , 12.3738675504 , 2.2362768749 , 3.53624063741 , 2.17194051215 , 1.80232955064 , 3.11447942993 , 5.58415288653 , 14.1053921526 , 8.57341416642 , 3.15187293847 , 2.76141329912 , 4.07248264248 , 1.99320484803 , 2.91473616599 , 2.20586857277 , 2.94563619851 , 5.42395269199 , 29.078302079 , 14.0218517407 , 20.5513224061 , 8.07341836515 , 6.53713071169 , 3.6100915748 , 2.98813230058 , 2.04783764553 , 2.60001717019 , 1.67795651189 , 2.92481559366 , 1.78590828584 , 0.883847519117 , 2.09792479628 , 2.77275673653 , 6.82743125648 , 2.05469069428 , 4.18963363872 , 5.88560779047 , 3.49943148138 , 2.40634975286 , 3.75794501409 , 3.99229239053 , 1.58456767841 , 3.45776889589 ] +# ftt1 = [ 3.31262327416 , 1.84214332676 , 1.11111111111 , 2.03014464168 , 1.93767258383 , 1.65447074293 , 9.03852728468 , 1.27301117686 , 1.26666666667 , 9.82712031558 , 10.434122288 , 10.373339908 , 9.46630506246 , 4.1728139382 , 5.41262327416 , 4.27879684418 , 6.29760026298 , 9.66288625904 , 11.6660420776 , 11.8333333333 , 10.6944444444 , 10.0307034845 , 3.57557527942 , 11.5675871137 , 10.4951347798 , 12.6495069034 , 8.61134122288 , 7.35282708744 , 15.2697238659 , 11.763477975 , 11.9313938199 , 5.16702827087 , 9.16988823143 , 13.1682117028 , 6.59408284024 , 11.0944444444 , 10.6555555556 , 9.95519395135 , 9.09247205786 , 6.50575279421 , 8.11604207758 , 7.55410913872 , 11.0204470743 , 9.8771860618 , 11.4343523997 , 12.8762656147 , 7.9865877712 , 9.08829717291 , 8.25016436555 , 5.91666666667 , 3.31130834977 , 9.45788954635 , 9.45358316897 , 11.9777120316 , 10.9437869822 , 12.5656147272 , 10.2722222222 , 12.8760026298 , 8.95239973702 , 10.3648915187 , 5.87370151216 , 4.64280078895 , 11.4609138725 , 12.0109467456 , 3.86985535832 , 2.52258382643 , 12.7899408284 , 12.5566732413 , 10.8793228139 , 8.65 , 3.78099934254 , 10.8026298488 , 7.08011176857 , 13.9724194609 , 8.85548980934 , 10.6792899408 , 1.92024983563 , 8.36048652202 , 10.8907626561 , 12.25539119 , 10.9333333333 , 8.59119000657 , 3.31245890861 , 6.69470742932 , 5.44224194609 , 8.9033530572 , 12.6318211703 , 8.3892504931 , 12.5443786982 , 11.1166666667 , 12.7669296515 , 5.2476660092 , 10.1997698882 , 7.16147271532 , 14.1570348455 , 12.6276134122 , 6.18612754767 , 8.52889546351 , 6.97771203156 , 5.6845496384 , 9.83563445102 , 4.45420775805 , 7.94322813938 , 11.9659763314 , 5.65262984878 , 11.1993754109 , 5.48007889546 , 3.85 , 7.94165023011 , 5.82501643655 , 13.3653188692 , 12.3447074293 , 8.30325443787 , 9.31564760026 , 1.98583168968 , 5.0335634451 , 3.27419460881 , 5.45749506903 , 9.69375410914 , 10.5053583169 , 5.52222222222 , 8.88484549638 , 4.34707429323 , 7.59566074951 , 11.1198224852 , 3.9771860618 , 14.2973701512 , 5.28652202498 , 9.70667324129 , 9.508382643 , 12.7611111111 , 8.00660749507 , 11.3608809993 , 15.2407955293 , 4.07712031558 , 11.8497370151 , 13.1331032216 , 11.6076265615 , 9.47376725838 , 5.78333333333 , 5.68783694938 , 5.93011176857 , 6.64806048652 , 5.23185404339 , 16.66617357 , 9.43609467456 , 2.10019723866 , 2.68957922419 , 4.42330703485 , 9.30023011177 , 10.2113412229 , 7.99375410914 , 8.58267587114 , 10.5413872452 , 5.42728468113 , 6.30785667324 , 8.36650230112 , 7.07001972387 , 8.60621301775 , 4.16111111111 , 5.93625904011 ] + time1 = [ 15.0 , 15.1 , 15.2 , 15.3 , 15.4 , 15.5 , 15.6 , 15.7 , 15.8 , 15.9 , 16.0 , 16.1 , 16.2 , 16.3 , 16.4 , 16.5 , 16.6 , 16.7 , 16.8 , 16.9 , 17.0 , 17.1 , 17.2 , 17.3 , 17.4 , 17.5 , 17.6 , 17.7 , 17.8 , 17.9 , 18.0 , 18.1 , 18.2 , 18.3 , 18.4 , 18.5 , 18.6 , 18.7 , 18.8 , 18.9 , 19.0 , 19.1 , 19.2 , 19.3 , 19.4 , 19.5 , 19.6 , 19.7 , 19.8 , 19.9 , 20.0 , 20.1 , 20.2 , 20.3 , 20.4 , 20.5 , 20.6 , 20.7 , 20.8 , 20.9 , 21.0 , 21.1 , 21.2 , 21.3 , 21.4 , 21.5 , 21.6 , 21.7 , 21.8 , 21.9 , 22.0 , 22.1 , 22.2 , 22.3 , 22.4 , 22.5 , 22.6 , 22.7 , 22.8 , 22.9 , 23.0 , 23.1 , 23.2 , 23.3 , 23.4 , 23.5 , 23.6 , 23.7 , 23.8 , 23.9 , 24.0 ] + #oftt1 = [ 3.34016987043 , 2.11315860427 , 3.18601772454 , 2.27078098197 , 1.9420457237 , 1.78898985201 , 3.73454058499 , 1.68480930255 , 3.0386681039 , 2.85571865734 , 3.67601949705 , 3.79573983327 , 2.14938619725 , 3.30385990796 , 2.52350280827 , 2.78920221392 , 2.33322730245 , 1.98399477751 , 1.60538259827 , 1.6598521442 , 1.32650828772 , 1.77548607706 , 1.99973719458 , 2.6260890102 , 0.836643695985 , 3.07519345155 , 1.07249957761 , 2.00305118752 , 2.5596876696 , 3.60327651365 , 1.7923848476 , 2.93387600578 , 2.10630249637 , 2.62657712208 , 4.46121606175 , 3.67395466752 , 6.08488199517 , 2.82596124205 , 3.91241243228 , 2.41879102395 , 5.58772604829 , 5.46544361042 , 2.28721049498 , 2.77276299549 , 3.76564829102 , 2.98083742388 , 2.27925861381 , 4.62218104164 , 2.28501948578 , 3.05490472895 , 3.46676593792 , 3.92566641941 , 2.17956934145 , 1.37175933222 , 6.96433390259 , 2.01892635736 , 1.26722331867 , 2.8570576534 , 1.13259061279 , 1.95600833705 , 3.03595447335 , 2.68137884379 , 2.422802909 , 1.68415431027 , 6.4498319049 , 3.96220874586 , 4.69988034974 , 4.07102932834 , 10.7651747519 , 1.81898918617 , 4.65267675925 , 6.19047595255 , 9.03167793854 , 6.76516119096 , 9.09661653142 , 5.77479201038 , 5.02901085492 , 7.21128650775 , 9.02549607313 , 4.47327569073 , 6.31552038723 , 3.84705878877 , 4.93029548398 , 7.19598955666 , 2.89317645075 , 2.24624292048 , 19.8300025219 , 16.3631961495 , 5.65725732509 , 7.03276276214 , 7.74351929772 ] + ofpt1 = [ 3.33126992611 , 2.15235043881 , 4.21215375236 , 2.04146402499 , 2.26508236112 , 1.75842743987 , 3.83752010319 , 1.79356812562 , 2.71647871756 , 2.98920028076 , 3.06963761795 , 3.78037524154 , 2.11330949347 , 3.62306600989 , 2.10132375418 , 2.79890211351 , 2.45220911956 , 2.0962944359 , 1.71888897623 , 2.00237892092 , 2.00237892092 , 1.75017286044 , 1.87819485903 , 2.77200592938 , 0.927552735382 , 2.16110258543 , 0.952612535679 , 1.55876494568 , 2.43936505277 , 2.74032154014 , 2.20187230613 , 2.62732676781, 1.81709347884 , 2.68646819361 , 4.87840695719 , 3.58804992604 , 1.96027598281 , 2.16400733578 , 4.55698744552 , 2.61612107743 , 4.1007299461 , 2.60197595024 , 2.42772928849 , 3.70504358394 , 2.64089183244 , 2.53083484208 , 2.69596558723 , 3.82189848477 , 2.10858933652 , 2.69381421149 , 4.48942308279 , 3.48776778082 , 1.75831208948 , 1.48030854681 , 3.2901866737 , 2.33799936521 , 1.50491990853 , 1.23953538087 , 1.19008302381 , 2.36576100342, 2.57888534853 , 2.052794471 , 2.64644323686 , 1.35534774334 , 5.6573022579 , 4.76819909982 , 1.85043233584 , 3.46190356262 , 5.28356384041 , 1.84882416982 , 3.01211103176 , 4.59728665448 , 8.01181670627 , 6.44190774176 , 7.57429158629 , 5.66900034971 , 4.30244931982 , 6.23339404063 , 6.88638460847 , 4.63713969717 , 5.75838213042 , 3.38303474858 , 4.29114582128 , 2.74825804228 , 2.33363923855 , 2.26640425042 , 4.06245325649 , 3.02492973852 , 4.13263598916, 4.06968874886 , 3.87911988994] + + time2 = [16.0 , 16.1 , 16.2 , 16.3 , 16.4 , 16.5 , 16.6 , 16.7 , 16.8 , 16.9 , 17.0 , 17.1 , 17.2 , 17.3 , 17.4 , 17.5 , 17.6 , 17.7 , 17.8 , 17.9 , 18.0, 18.1 , 18.2 , 18.3 , 18.4 , 18.5 , 18.6 , 18.7 , 18.8 , 18.9 , 19.0 , 19.1 , 19.2 , 19.3 , 19.4 , 19.5 , 19.6 , 19.7 , 19.8 , 19.9 , 20.0, 20.1 , 20.2 , 20.3 , 20.4 , 20.5 , 20.6 , 20.7 , 20.8 , 20.9 , 21.0 , 21.1 , 21.2 , 21.3 , 21.4 , 21.5 , 21.6 , 21.7 , 21.8 , 21.9 , 22.0, 22.1 , 22.2 , 22.3 , 22.4 , 22.5 , 22.6 , 22.7 , 22.8 , 22.9 , 23.0 , 23.1 , 23.2 , 23.3 , 23.4 , 23.5 , 23.6 , 23.7 , 23.8 , 23.9 , 24.0] + oftt1 = [4.69668769016 , 5.22815511796 , 4.75651864455 , 7.27951179414 , 1.83936252642 , 2.92045248929 , 3.27799965301 , 5.89231086353 , 7.41883633633 , 5.29257760195 , 1.29865347968 , 7.08251471428 , 16.9714386887 , 3.68136567864 , 4.6412439188 , 3.88903306758 , 3.54682791884 , 3.73403607414 , 6.9666255785 , 20.3582630944 , 3.19957891476, 3.80543310502 , 1.93401424702 , 3.17057766458 , 3.96305911318 , 6.51887629373 , 20.4186073407 , 11.4147131854 , 3.85847773442 , 3.11570712986 , 3.50262623757 , 2.22010631502 , 2.31444421917 , 2.59850885854 , 2.68293911389 , 6.75030937958 , 43.7200549223 , 21.8209065471 , 29.7734428877 , 10.3799544067 , 7.0800434828, 4.84267494922 , 2.87969582577 , 1.73273692692 , 3.36322225073 , 1.95472294708 , 2.32214555282 , 1.50623440831 , 1.09532940564 , 1.76316748388 , 2.68600217437 , 8.51850047806 , 3.06249792008 , 3.8621030668 , 10.2604727585 , 5.18644468396 , 1.89713897743 , 3.90466259625 , 5.35529750254 , 1.55552123283 , 2.9387445849, 3.87210768706 , 6.7209386312 , 7.24779869356 , 6.87608364896 , 5.11448242313 , 4.95290896891 , 6.55150709768 , 5.4000674614 , 4.36536378271 , 4.45552987643 , 3.45963586477 , 4.39443102979 , 3.25922301023 , 1.95031262487 , 2.22012292429 , 4.23730662071 , 8.2025886652 , 10.6547490425 , 3.34325981498 , 3.56071448287 ] + time = [] + oftt= [] + ftt = [] + ofpt = [] + for time10 in range(160,241,10): + time01 = time10 / 10.0 + for i in range(len(time1)): + if time1[i] == time01: + time.append(time1[i]) + ofpt.append(ofpt1[i]) + break + for j in range(len(time2)): + if time2[j] == time01: + oftt.append(oftt1[j]) + print oftt1[j] + break + print 'MEAN - oftt: ',np.mean(oftt) + print 'MEAN - ofpt: ', np.mean(ofpt) + + fig = plt.figure(1) + errorDis1 = plt.subplot(1,1,1) + ax=plt.gca() + for tick in ax.xaxis.get_major_ticks(): + tick.label1.set_fontsize(xfontsize) + for tick in ax.yaxis.get_major_ticks(): + tick.label1.set_fontsize(yfontsize) + xlim(16,24) + ylim(0, 10) + errorDis1.set_xlabel('Time',size=xlabelsize) + errorDis1.set_ylabel('MSE',size=ylabelsize) + errorDis1.plot(time,oftt,'pb-',label='TPO-T', linewidth=lwidth, markersize=psize,markerfacecolor='none',markeredgecolor='b',markeredgewidth=mewidth) + errorDis1.plot(time,ofpt,'or--',label='TPO-P', linewidth = lwidth, markersize=osize,markerfacecolor='none',markeredgecolor='r',markeredgewidth=mewidth) + errorDis1.legend(bbox_to_anchor=(0.4, 1), prop={'size':legendsize}) + plt.grid(True, linewidth = gridwidth) + plt.show() +elif graph == 21:#TPO-T training length + leng = [1, 2, 4, 6, 8, 10, 12] + mse = [11.3630137637, 8.30783926981, 6.1372113718, 5.69388283632, 4.53503860232, 3.56379580345, 3.34194715277] + fig = plt.figure(1) + errorDis1 = plt.subplot(1,1,1) + ax=plt.gca() + for tick in ax.xaxis.get_major_ticks(): + tick.label1.set_fontsize(xfontsize) + for tick in ax.yaxis.get_major_ticks(): + tick.label1.set_fontsize(yfontsize) + ax.set_xticks(np.linspace(1,12,12)) + ax.set_xticklabels( ('1', '2', '3', '4', '5', '6', '7', '8','9','10','11','12')) + errorDis1.set_xlabel('Training Length (week)',size=xlabelsize) + errorDis1.set_ylabel('Mean MSE',size=ylabelsize) + errorDis1.plot(leng,mse,'pb-',label='TPO-T', linewidth = lwidth, markersize=psize,markerfacecolor='none',markeredgecolor='b',markeredgewidth=mewidth) + ylim(1,15) + xlim(1, 12) + errorDis1.legend(bbox_to_anchor=(0.5, 1), loc=0, borderaxespad=0.,prop={'size':legendsize}) + plt.grid(True, linewidth = gridwidth) +elif graph == 22:#performance of different zones + per = [1,5,10,20,30,60,120] + mse = [15.3433176586, 10.3045890768, 9.66024002956, 8.93674166049, 6.60237428115, 4.88553217152, 5.03451190563] + + fig = plt.figure(1) + errorDis1 = plt.subplot(1,1,1) + ax=plt.gca() + for tick in ax.xaxis.get_major_ticks(): + tick.label1.set_fontsize(xfontsize-5) + for tick in ax.yaxis.get_major_ticks(): + tick.label1.set_fontsize(yfontsize-5) + + majorLocator = MultipleLocator(10) + majorFormatter = FormatStrFormatter('%d') + minorLocator = MultipleLocator(5) + ax.xaxis.set_major_locator(majorLocator) + ax.xaxis.set_major_formatter(majorFormatter) + # for the minor ticks, use no labels; default NullFormatter + ax.xaxis.set_minor_locator(minorLocator) + + errorDis1.set_xlabel('Number of Training Zones',size=xlabelsize) + errorDis1.set_ylabel('Mean MSE',size=ylabelsize) + errorDis1.plot(per,mse,'*r-',label='TPO-T', linewidth = lwidth, markersize=starsize,markerfacecolor='none',markeredgecolor='r',markeredgewidth=mewidth) + ylim(0,20) + xlim(0,120) + errorDis1.legend(bbox_to_anchor=(0.5, 1), loc=0, borderaxespad=0.,prop={'size':legendsize}) + plt.grid(True, linewidth = gridwidth) +elif graph == 23: #cdf of TPO-P and TP-P +#TPO-P v.s. TP-P: the percentile of all test days as a function of MSE. + import numpy as np + from sklearn.metrics import mean_squared_error + import matplotlib.pyplot as plt + import statsmodels.api as sm # recommended import according to the docs + + pic = plt.subplot(1,1,1) + plt.rcParams['xtick.labelsize'] = xfontsize + plt.rcParams['ytick.labelsize'] = yfontsize + #plt.rcParams['axes.labelsize'] = xlabelsize #label is set below + + time = 21 + if time == 16.0: + Real = [58.0, 59.0, 67.0, 59.0, 58.0, 56.0, 58.0, 60.0, 57.0, 63.0, 60.0, 59.0, 60.0, 56.0, 58.0, 62.0, 66.0, 58.0, 59.0, 61.0, 57.0, 60.0, 56.0, 62.0, 59.0, 62.0, 57.0, 62.0, 57.0, 58.0] + traflwr = [58.6109092467781, 59.050695650762634, 64.00413230201886, 57.902966650678863, 60.19655260893694, 57.463925700868806, 59.050975841849045, 59.050585666425299, 58.667950803699803, 66.040904141199164, 57.350234759976644, 59.050467761293305, 59.872036985561536, 57.463463368263582, 59.432766715940346, 59.992725070311501, 66.70279919414584, 58.285889317765616, 59.756016898223095, 59.107508506517277, 59.050840905634246, 58.668286532485396, 57.788039112440018, 65.38677071898087, 58.610727580298665, 60.196636361088984, 56.968608886515923, 59.98625175354973, 58.112541296752063, 59.988382536151555] + elif time == 17.0: + Real = [59.0, 58.0, 67.0, 59.0, 59.0, 60.0, 56.0, 59.0, 56.0, 68.0, 59.0, 59.0, 59.0, 59.0, 60.0, 56.0, 67.0, 59.0, 60.0, 59.0, 59.0, 62.0, 56.0, 67.0, 58.0, 58.0, 59.0, 57.0, 58.0, 56.0] + traflwr = [57.00448927188409, 60.076068033248177, 65.229508652821991, 59.102093311927568, 58.947406572774099, 57.178362690652982, 58.46157802538665, 61.201192631123362, 59.276218318372436, 64.119741791659052, 59.744172153908039, 58.13139195479534, 59.745312018925716, 57.178476157887765, 59.913966695996557, 60.54031318107571, 65.559249422289071, 57.004584926098687, 59.587479029834157, 60.870959492073013, 56.363721577004178, 60.228777235570213, 56.693233333701286, 64.942504567754142, 59.102254913406298, 60.541925649016733, 57.820258977118364, 62.486284487635629, 57.819813111332948, 57.00483713939569] + elif time == 18.0: + Real = [58.0, 56.0, 64.0, 60.0, 59.0, 59.0, 58.0, 59.0, 60.0, 64.0, 58.0, 62.0, 58.0, 59.0, 59.0, 61.0, 62.0, 60.0, 56.0, 57.0, 59.0, 57.0, 59.0, 66.0, 59.0, 56.0, 59.0, 59.0, 56.0, 58.0] + traflwr = [59.076751782795007, 58.773590296953373, 63.046163642548272, 59.231102588615478, 58.614077114865161, 58.763073759986881, 57.396575065996089, 58.768215134917298, 57.090483996737838, 63.502622917275886, 58.614074873126192, 58.768215134917298, 58.768031159138474, 58.460301825405971, 59.224816324581703, 56.938005068065237, 63.045561138077232, 58.768013735450381, 59.070426206029964, 58.922384132567622, 58.76822484887024, 59.829151591099915, 57.552570126873725, 63.676141410442625, 58.311540246964547, 58.157335692564629, 58.613912197044918, 57.854841751585923, 58.157801781915467, 56.93720228451491] + elif time == 19.0: + Real = [59.0, 61.0, 67.0, 58.0, 59.0, 60.0, 59.0, 60.0, 56.0, 69.0, 56.0, 60.0, 62.0, 59.0, 60.0, 59.0, 66.0, 62.0, 62.0, 58.0, 62.0, 59.0, 58.0, 69.0, 62.0, 59.0, 60.0, 56.0, 58.0, 60.0] + traflwr = [58.344934243257541, 59.272907138228305, 65.811375986303304, 59.742264968267726, 60.668799601948095, 59.275134042727984, 58.808421956763169, 59.739848339396403, 59.278219477321414, 65.345845598353023, 58.808982292853528, 59.284701068115858, 58.345118601322888, 59.275832292071087, 59.739715263681923, 58.818593529508178, 63.475172445202254, 59.741106957417088, 57.875596832948517, 58.342339240373462, 59.275471681633313, 59.736918135601172, 60.204177530078162, 66.73208743619783, 58.811519393848144, 57.875850093314263, 59.275160313625001, 60.669114664659645, 58.340430336616457, 58.345279741433053] + elif time == 20.5: + Real = [58.0, 59.0, 67.0, 60.0, 59.0, 59.0, 59.0, 59.0, 59.0, 66.0, 58.0, 57.0, 59.0, 59.0, 58.0, 61.0, 67.0, 58.0, 57.0, 62.0, 62.0, 62.0, 59.0, 68.0, 59.0, 59.0, 58.0, 59.0, 59.0, 60.0] + traflwr = [56.842804354796073, 59.147202979031952, 66.706229416640568, 58.562111778093112, 60.037402006730886, 59.76263962172532, 59.424076488839177, 60.279953047073491, 60.03892597560413, 63.51338309904984, 59.145313206652155, 58.807291896629508, 58.870944830801157, 59.420912412188365, 59.115392926290696, 58.838329581046551, 63.86243647987861, 60.005764246936735, 60.83461923884375, 59.976534877205218, 57.394739712077772, 58.562626393240308, 58.838167723513074, 64.098629440548237, 59.421606576689925, 58.867966760691026, 60.008236865650737, 61.176108849972366, 57.394806878248723, 60.622772148640898] + elif time == 21.0: + Real = [67.0, 65.0, 67.0, 62.0, 62.0, 63.0, 63.0, 64.0, 67.0, 68.0, 63.0, 63.0, 67.0, 62.0, 63.0, 70.0, 67.0, 63.0, 67.0, 63.0, 63.0, 61.0, 71.0, 67.0, 63.0, 62.0, 63.0, 63.0, 64.0, 73.0] + traflwr = [65.870340134926678, 65.026037581466525, 65.948163465176449, 64.977649955657313, 64.927417951671018, 64.915616170947317, 65.447637754705013, 64.333302903930075, 65.680165521385589, 66.485451570592986, 64.806251643916497, 65.806899354258178, 64.915071443375581, 64.321983138880299, 64.804202801354833, 64.742391697873373, 66.308671988115009, 65.211223200974445, 65.618519021631059, 64.928303283400282, 64.572308099480011, 64.976886250467516, 64.790454859220858, 66.485023164067101, 65.744999704699083, 64.977493285649018, 64.557153815581614, 65.399055603007099, 64.792170194005678, 64.976643269850229] + elif time == 20.0: + Real = [62.0, 56.0, 63.0, 59.0, 62.0, 58.0, 59.0, 60.0, 59.0, 64.0, 60.0, 61.0, 58.0, 56.0, 60.0, 59.0, 65.0, 59.0, 58.0, 62.0, 60.0, 59.0, 56.0, 64.0, 60.0, 59.0, 56.0, 62.0, 56.0, 59.0] + traflwr = [58.898108852462904, 59.715162972333424, 64.191838953617733, 58.997079449805057, 59.236393300599445, 58.798746308931158, 59.576262501351465, 58.799643963917276, 58.180483997660303, 62.97377997733394, 58.518400385545384, 59.137718456352793, 59.614598948078019, 59.575530699780479, 59.815114244294676, 59.236150336764872, 62.93981183835772, 59.953701668968016, 59.277524397341779, 59.338322595623751, 59.954210054355954, 58.559281669060155, 59.336890042238373, 63.989981643877506, 59.953872691945982, 58.219137592367574, 59.814210407941744, 57.839695414114423, 60.015824429702377, 59.476049390977593] + elif time == 22.0: + Real = [66.0, 69.0, 66.0, 65.0, 66.0, 70.0, 66.0, 63.0, 65.0, 68.0, 66.0, 68.0, 64.0, 65.0, 66.0, 66.0, 69.0, 65.0, 66.0, 66.0, 64.0, 70.0, 69.0, 70.0, 65.0, 66.0, 66.0, 65.0, 66.0, 69.0] + traflwr = [67.204897095112045, 66.56733143572616, 68.472780477204154, 65.700441657828122, 65.339746178495204, 65.568336524732445, 66.289034123771202, 65.97771154388505, 67.747436505325538, 69.064077637630476, 65.568693625711731, 65.568336524732445, 67.204689833325261, 64.979207025422227, 65.388083146611649, 67.888920825194404, 67.928947356760602, 65.568251582293087, 67.024367213958712, 65.568642916573623, 65.568149202996793, 64.749488870390891, 69.382944037587379, 68.836204464662373, 65.388026641973511, 64.979070141623311, 65.568234053212009, 65.929157233213999, 65.977640378328886, 70.200033594911105] + elif time == 21.5: + Real = [62.0, 69.0, 73.0, 65.0, 65.0, 64.0, 65.0, 70.0, 70.0, 65.0, 65.0, 62.0, 65.0, 65.0, 66.0, 70.0, 68.0, 69.0, 66.0, 66.0, 62.0, 67.0, 69.0, 73.0, 66.0, 65.0, 66.0, 67.0, 66.0, 70.0] + traflwr = [65.792920708610879, 65.7697668201358, 67.651944259582322, 65.939338809978821, 65.769440585449402, 65.834064110948944, 65.704450888345292, 65.963064688601605, 65.575390162021364, 67.728397312732184, 65.600416372145915, 65.430605604321556, 65.833877647094894, 65.769678722410504, 65.405057622423229, 66.04379282460998, 67.904294173280491, 65.599511844769538, 65.432038784157726, 66.28119078419445, 66.084832331923323, 66.472749689767966, 65.770246110494483, 67.639583504364722, 65.704793856243299, 65.769608309209502, 65.599905513726668, 65.96285088588742, 65.639327163858923, 65.939529345553467] + print mean_squared_error(Real, traflwr) + + mse = [] + for i in range(100): + mse.append(0) + + MSE = [] + cnt = 0 + for i in range(len(Real)): + temp = int(np.ceil((traflwr[i] - Real[i])*(traflwr[i] - Real[i]))) + print temp + mse[temp] += 1 + cnt += 1 + MSE.append(temp) + + print mse + ecdf = sm.distributions.ECDF(MSE) + x = np.linspace(min(MSE), max(MSE)) + y = ecdf(x) + #print x + #print y + + X = [] + Y = [] + X.append(0.1) + Y.append(0) + for xx in x: + X.append(xx) + for yy in y: + Y.append(yy) + X.append(x[-1]) + Y.append(y[-1]) + #print X + #print Y + #ylim(min(Y),max(Y)+0.01) + xlim(min(X)-0.1,30) + plt.step(X, Y,'.r-',label='TP-P', linewidth = 3.5,markersize=20) + #plt.show() + b = 30 + #leng = len(Y) + #print leng + pic.legend(bbox_to_anchor=(0.47, 1), loc=0, borderaxespad=0.,prop={'size':legendsize}) + + if time == 16.0: + Real = [58.0, 59.0, 58.0, 56.0, 58.0, 60.0, 60.0, 59.0, 60.0, 56.0, 58.0, 58.0, 59.0, 61.0, 57.0, 60.0, 59.0, 62.0, 57.0, 62.0, 57.0] + Occtraflwr = [58.920621425008449, 58.291577091475219, 59.32294102666107, 58.518773321619868, 58.87247933148354, 58.836231372682484, 59.179407677396966, 58.899737397766756, 58.920695547726083, 58.597767224241245, 59.04375628032745, 58.75574316360138, 59.622693078707535, 58.652352255611049, 58.909935842210096, 58.828047158709246, 59.094413053126431, 59.38699857527974, 58.998641045169713, 58.198583478889596, 59.538340558365007] + elif time == 17.0: + Real = [59.0, 59.0, 59.0, 60.0, 56.0, 59.0, 59.0, 59.0, 59.0, 59.0, 60.0, 59.0, 60.0, 59.0, 59.0, 62.0, 58.0, 58.0, 59.0, 57.0, 58.0] + Occtraflwr = [58.819110907218089, 58.754440850740252, 58.707566598243211, 58.691671314068877, 58.758768758296462, 58.693374206687253, 58.79395041937714, 58.825970794828692, 58.799346076728348, 58.705427701363377, 58.665535340936685, 58.866990631146201, 58.773317862360578, 58.799104491440758, 58.842071482687309, 58.777559913611604, 58.804107070134286, 58.889079660011667, 58.738712233540099, 58.77692611422853, 58.744114787827947] + elif time == 18.0: + Real = [58.0, 60.0, 59.0, 59.0, 58.0, 59.0, 58.0, 62.0, 58.0, 59.0, 59.0, 60.0, 56.0, 57.0, 59.0, 57.0, 59.0, 56.0, 59.0, 59.0, 56.0] + Occtraflwr = [58.447769637707772, 58.366154904081149, 58.730416828547575, 59.024014142002422, 58.22982464557392, 58.640574644085966, 58.764229639154081, 58.719729935365841, 58.670967537145501, 58.864195872538637, 58.806820474500697, 58.592547678126081, 58.938344633399268, 58.527407224811228, 58.63196901393249, 59.011548917637107, 58.606296098351109, 58.582475829969361, 58.671356274513172, 58.454252929307778, 58.627615925678036] + elif time == 19.0: + Real = [59.0, 58.0, 59.0, 60.0, 59.0, 60.0, 56.0, 60.0, 62.0, 59.0, 60.0, 62.0, 62.0, 58.0, 62.0, 59.0, 62.0, 59.0, 60.0, 56.0, 58.0] + Occtraflwr = [58.555037814836311, 58.936393832203365, 58.589226966559629, 58.155545770382076, 58.205453236714149, 58.448309518584907, 58.25920046722954, 59.497570305311072, 58.440651250943446, 58.762359530958292, 58.99015307298825, 58.438368231684436, 58.512435664946288, 58.419270420991495, 58.496861544770965, 58.177733088116561, 58.476850541288108, 58.228870517925472, 58.424488254722625, 58.387422167887898, 58.409390453609454] + elif time == 20.5: + Real = [58.0, 60.0, 59.0, 59.0, 59.0, 59.0, 58.0, 57.0, 59.0, 59.0, 58.0, 58.0, 57.0, 62.0, 62.0, 62.0, 59.0, 59.0, 58.0, 59.0, 59.0] + Occtraflwr = [58.889618169823564, 58.420855476570232, 58.215523282400596, 58.106694214154224, 58.332925595911426, 58.189297893611069, 58.365262976457707, 58.597107290226035, 58.41166517580907, 58.29045799921834, 58.522614384064603, 58.330896564285659, 58.15962756501817, 58.444565820038505, 58.670679927855645, 58.466677832171946, 58.376497338584954, 58.377036778214858, 58.373019002788361, 58.097996223511366, 58.689049616530397] + elif time == 21.0: + Real = [67.0, 62.0, 62.0, 63.0, 63.0, 64.0, 63.0, 63.0, 67.0, 62.0, 63.0, 63.0, 67.0, 63.0, 63.0, 61.0, 63.0, 62.0, 63.0, 63.0, 64.0] + Occtraflwr = [63.134976389584118, 63.405328773536496, 63.022932289179764, 63.593816507071921, 63.417241302998001, 63.257910052549406, 63.243446343930202, 63.246259625203187, 63.654006493057437, 63.946756160407944, 63.318866368035124, 63.423860203386802, 63.809153147762842, 63.225209091880565, 63.267845375124267, 63.511181376241602, 63.368189494434674, 63.432380588569039, 63.942082646980836, 63.046744689149229, 63.786257085620562] + elif time == 20.0: + Real = [62.0, 59.0, 62.0, 58.0, 59.0, 60.0, 60.0, 61.0, 58.0, 56.0, 60.0, 59.0, 58.0, 62.0, 60.0, 59.0, 60.0, 59.0, 56.0, 62.0, 56.0] + Occtraflwr = [59.294513999253304, 58.931649923731186, 59.530798058866878, 58.648758165487834, 59.570298718257916, 59.063033574754179, 58.900275122566747, 59.602183385946823, 59.46573645982707, 59.658626071221853, 59.793530881061216, 60.245556545510354, 59.492015063326981, 59.044903637092091, 59.796526927502718, 58.613187952693359, 59.627741116562298, 58.473638844341963, 59.954545371782764, 58.117813390860881, 60.082419453326885] + elif time == 22.0: + Real = [66.0, 65.0, 66.0, 70.0, 66.0, 63.0, 66.0, 68.0, 64.0, 65.0, 66.0, 65.0, 66.0, 66.0, 64.0, 70.0, 65.0, 66.0, 66.0, 65.0, 66.0] + Occtraflwr = [66.068646487838649, 65.231697872899204, 65.579095187064297, 65.907918320189907, 64.980206231479869, 65.976068175288148, 65.913910513310185, 65.968362816357427, 66.385849920371854, 66.023987873361406, 66.097527474567997, 65.828888852474435, 66.489018871206639, 66.066683243151715, 65.895392456622233, 65.676364698229733, 66.154104847306158, 66.381244066382976, 65.869619618572713, 65.882249675567593, 66.041606632709986] + elif time == 21.5: + Real = [62.0, 65.0, 65.0, 64.0, 65.0, 70.0, 65.0, 62.0, 65.0, 65.0, 66.0, 69.0, 66.0, 66.0, 62.0, 67.0, 66.0, 65.0, 66.0, 67.0, 66.0] + Occtraflwr = [64.637061879563277, 64.827712685964158, 64.660673757850205, 64.389170908673634, 64.974209990210497, 64.4106996949006, 65.178985804820726, 65.325190866464311, 64.697744387975817, 64.717490058644714, 65.61990544475114, 64.988643707129029, 65.231116605223121, 64.169343671591207, 64.76600264534575, 63.428361153439241, 65.052724273938793, 64.829028984969554, 65.105322650179431, 64.222671695835018, 65.40427324002367] + print mean_squared_error(Real, Occtraflwr) + + mse = [] + for i in range(20): + mse.append(0) + MSE = [] + cnt = 0 + for i in range(len(Real)): + temp = int(np.ceil((Occtraflwr[i] - Real[i])*(Occtraflwr[i] - Real[i]))) + mse[temp] += 1 + cnt += 1 + MSE.append(temp) + #print mse + ecdf = sm.distributions.ECDF(MSE) + x = np.linspace(min(MSE), max(MSE)) + y = ecdf(x) + #print x + #print y + + + X = [] + Y = [] + X.append(0.1) + Y.append(0) + for xx in x: + X.append(xx) + for yy in y: + Y.append(yy) + X.append(x[-1]) + Y.append(y[-1]) + + #print X + #print len(Y) + ylim(min(Y),max(Y)+0.01) + #xlim(min(X)-0.1,max(X)) + ax=plt.gca() + ax.set_xticks(np.linspace(0,30,11)) + ax.set_xticklabels( ('0', '3', '6', '9', '12', '15', '18', '21','24','27','30')) + ax.set_yticks(np.linspace(0,1,9)) + ax.set_yticklabels( ('0.00', '0.125', '0.25', '0.375', '0.50','0.625','0.75','0.875','1.0')) + + pic.set_xlabel('Squared Error',size=xlabelsize) + pic.set_ylabel('Percentile',size=ylabelsize) + plt.step(X, Y, 'k-',label='TPO-P', linewidth=3.5) + pic.legend(bbox_to_anchor=(0.95, 0.5), loc=0, borderaxespad=0.,prop={'size':legendsize}) + + a = np.linspace(max(X),b) + c=[] + for aa in range(len(a)): + c.append(1) + a = np.linspace(max(X),b) + c=[] + for aa in range(len(a)): + c.append(1) + pic.plot(a,c,'k-',linewidth=3.5) + + plt.grid(True, linewidth = gridwidth) + plt.show() + +elif graph == 31:#weight of occupancy/traffic - different prediction time +#Weight of Occupancy v.s. Traffic, 20:00-22:00. + time = [0.2, 0.4, 0.6, 0.8, 1, 1.2] + occ = [1.33620255151, 4.95949772586, 1.26187717795, 0.990177728744, 1.2777695719, 0.0484706064585] + traf = [1,1,1,1,1,1] + + #traf = [0.0108831159948, 0.0108958069672, 0.0629231822061, 0.0615828235894, 0.0629231822061, 0.0143713279428] + #0.0145420473606 0.0540377298752 0.0794013275901 0.0609779403914 0.0804013275901 0.00206971826242 0.0389080100848 0.0191253722211 + #0.0108831159948 0.0108958069672 0.0629231822061 0.0615828235894 0.0629231822061 0.0427004820786 0.0287928551123 0.0143713279428 + + print 'MEAN - occ/traf: ',np.mean(occ) + #print 'MEAN - traf:', np.mean(traf) + + + fig = plt.figure(1) + errorDis1 = plt.subplot(1,1,1) + ax=plt.gca() + for tick in ax.xaxis.get_major_ticks(): + tick.label1.set_fontsize(xfontsize) + for tick in ax.yaxis.get_major_ticks(): + tick.label1.set_fontsize(yfontsize) + ax.set_yticks(np.linspace(0,5,6)) + ax.set_yticklabels( ('0', '1', '2', '3', '4', '5')) + ax.set_xticks(np.linspace(0,1.2,7)) + ax.set_xticklabels( ('0', '0.2', '0.4', '0.6', '0.8', '1', '1.2')) + errorDis1.set_xlabel('Prediction Length (hour)',size=xlabelsize) + errorDis1.set_ylabel('The Ratio of Weight',size=ylabelsize) + errorDis1.plot(time,occ,'pb-',label='Occupancy/Traffic', linewidth=lwidth, markersize=psize,markerfacecolor='none',markeredgecolor='b',markeredgewidth=mewidth) + errorDis1.plot(time,traf,'r--', linewidth=lwidth, markersize=40,markerfacecolor='r',markeredgecolor='r') + errorDis1.legend(bbox_to_anchor=(1, 1), prop={'size':legendsize}) + plt.show() + ylim(-0.5,5.2) + xlim(0.179,1.22) + +elif graph == 32:#TPO-T vs TP-P 200-220 +#TPO-T v.s. TP-P: MSE as a function of time, 20:00-22:00. + time1 =[ 15.0 , 15.1 , 15.2 , 15.3 , 15.4 , 15.5 , 15.6 , 15.7 , 15.8 , 15.9 , 16.0 , 16.1 , 16.2 , 16.3 , 16.4 , 16.5 , 16.6 , 16.7 , 16.8 , 16.9 , 17.0 , 17.1 , 17.2 , 17.3 , 17.4 , 17.5 , 17.6 , 17.7 , 17.8 , 17.9 , 18.0 , 18.1, 18.2 , 18.3 , 18.4 , 18.5 , 18.6 , 18.7 , 18.8 , 18.9 , 19.0 , 19.1 , 19.2 , 19.3 , 19.4 , 19.5 , 19.6 , 19.7 , 19.8 , 19.9 , 20.0 , 20.1 , 20.2 , 20.3 , 20.4 , 20.5 , 20.6 , 20.7 , 20.8 , 20.9, 21.0 , 21.1 , 21.2 , 21.3 , 21.4 , 21.5 , 21.6 , 21.7 , 21.8 , 21.9 , 22.0 , 22.1 , 22.2 , 22.3 , 22.4 , 22.5 , 22.6 , 22.7 , 22.8 , 22.9 , 23.0 , 23.1 , 23.2 , 23.3 , 23.4 , 23.5 , 23.6 , 23.7 , 23.8, 23.9 , 24.0] + traf1 = [ 3.96618645819 , 4.04497622846 , 3.39075473611 , 4.7234606614 , 4.164909464 , 3.74929904373 , 3.90519374081 , 4.01099285863 , 4.64369992486 , 4.57965918692 , 2.82826888741 , 5.0604905316 , 3.99257536387 , 7.18455151752 , 2.36224254873 , 4.16547682492 , 3.34751996066 , 3.58983560969 , 2.43789160656 , 2.54892943846 , 2.54892943846 , 4.86102740209 , 4.39002674918 , 3.4733625116 , 1.65661314039 , 4.30196947144 , 1.85158868053 , 3.45453815456 , 8.26514748182 , 3.39325035825 , 3.05344100669 , 4.92566172441 , 3.90778176245 , 2.98940013899 , 7.03302763038 , 4.51793391538 , 5.11233797865 , 3.58112845539 , 5.31103060742 , 5.36028896036 , 4.68315982201 , 4.68057920356 , 10.2563604348 , 7.45090549345 , 3.48067021098 , 4.95830331286 , 6.78096463283 , 5.14312042025 , 2.79491732187 , 3.85133045544 , 4.39286091368 , 4.15029338914 , 2.69199038573 , 2.6877504365 , 6.18964671317 , 3.92690164743 , 1.4216195593 , 2.32972493884 , 2.68810883884 , 3.07620211093 , 8.10307709548 , 6.24938041557 , 4.41333952399 , 5.74221501923 , 4.89501154313 , 7.2711287331 , 9.07431829147 , 4.32086457158 , 8.21095270683 , 2.74730418402 , 3.6636698868 , 4.57328849058 , 5.80687995343 , 6.95878485269 , 7.72893462061 , 7.02814142419 , 5.05219816438 , 5.44598003157 , 6.13105945609 , 4.38539146046 , 6.26051298642 , 7.82124811496 , 6.47002032166 , 10.1974933772 , 3.6415823182 , 8.26392144517 , 4.41229726097 , 3.56887666101 , 6.36807457898 , 6.53689879115 , 6.50894555372 ] + occ1 = [ 3.34016987043 , 2.11315860427 , 3.18601772454 , 2.27078098197 , 1.9420457237 , 1.78898985201 , 3.73454058499 , 1.68480930255 , 3.0386681039 , 2.85571865734 , 3.67601949705 , 3.79573983327 , 2.14938619725 , 3.30385990796 , 2.52350280827 , 2.78920221392 , 2.33322730245 , 1.98399477751 , 1.60538259827 , 1.6598521442 , 1.32650828772 , 1.77548607706 , 1.99973719458 , 2.6260890102 , 0.836643695985 , 3.07519345155 , 1.07249957761 , 2.00305118752 , 2.5596876696 , 3.60327651365 , 1.7923848476 , 2.93387600578 , 2.10630249637 , 2.62657712208 , 4.46121606175 , 3.67395466752 , 6.08488199517 , 2.82596124205 , 3.91241243228 , 2.41879102395 , 5.58772604829 , 5.46544361042 , 2.28721049498 , 2.77276299549 , 3.76564829102 , 2.98083742388 , 2.27925861381 , 4.62218104164 , 2.28501948578 , 3.05490472895 , 3.46676593792 , 3.92566641941 , 2.17956934145 , 1.37175933222 , 6.96433390259 , 2.01892635736 , 1.26722331867 , 2.8570576534 , 1.13259061279 , 1.95600833705 , 3.03595447335 , 2.68137884379 , 2.422802909 , 1.68415431027 , 6.4498319049 , 3.96220874586 , 4.69988034974 , 4.07102932834 , 8.7651747519 , 1.81898918617 , 4.65267675925 , 6.19047595255 , 9.03167793854 , 6.76516119096 , 9.09661653142 , 5.77479201038 , 5.02901085492 , 7.21128650775 , 9.02549607313 , 4.47327569073 , 6.31552038723 , 3.84705878877 , 4.93029548398 , 7.19598955666 , 2.89317645075 , 2.24624292048 , 19.8300025219 , 16.3631961495 , 5.65725732509 , 7.03276276214 , 7.74351929772 ] + time = [] + traf= [] + occ = [] + for time10 in range(160,240,1): + time01 = time10 / 10.0 + + for i in range(len(time1)): + if time1[i] == time01: + if occ1[i] > 10: + print occ1[i] + time.append(time1[i]) + traf.append(traf1[i]) + occ.append(occ1[i]) + break + + time.append(time1[-1]) + traf.append(traf1[-1]) + occ.append(occ1[-1]) + print 'MEAN -occ: ',np.mean(occ) + print 'MEAN - traf:', np.mean(traf) +# cntT = 0 +# cntO = 0 +# for i in range(len(traf)): +# if traf[i] < occ[i]: +# cntT += 1 +# else: +# cntO += 1 +# print "T win: ", cntT +# print "O win: ", cntO + + xlim(20,22) + #xlim(16,24) + ylim(0,10) + fig = plt.figure(1) + errorDis1 = plt.subplot(1,1,1) + ax=plt.gca() + for tick in ax.xaxis.get_major_ticks(): + tick.label1.set_fontsize(xfontsize) + for tick in ax.yaxis.get_major_ticks(): + tick.label1.set_fontsize(yfontsize) + errorDis1.set_xlabel('Time',size=xlabelsize) + errorDis1.set_ylabel('MSE',size=ylabelsize) + errorDis1.plot(time,occ,'pb-',label='TPO-T', linewidth=lwidth, markersize=psize,markerfacecolor='none',markeredgecolor='b',markeredgewidth=mewidth) + errorDis1.plot(time,traf,'*r--',label='TP-P', linewidth = lwidth, markersize=starsize,markerfacecolor='none',markeredgecolor='r',markeredgewidth=mewidth) + errorDis1.legend(bbox_to_anchor=(0.30, 1.03), prop={'size':legendsize}) + plt.grid(True, linewidth = gridwidth) + plt.show() + +elif graph == 33.1:#Lin Cheung - TPO-T VS TP-T +#TPO-T v.s. TP-T: MSE as a function of time (a) 16:00-24:00 + time1 = [ 16.0 , 16.1 , 16.2 , 16.3 , 16.4 , 16.5 , 16.6 , 16.7 , 16.8 , 16.9 , 17.0 , 17.1 , 17.2 , 17.3 , 17.4 , 17.5 , 17.6 , 17.7 , 17.8 , 17.9 , 18.0 , 18.1 , 18.2 , 18.3 , 18.4 , 18.5 , 18.6 , 18.7 , 18.8 , 18.9 , 19.0 , 19.1 , 19.2 , 19.3 , 19.4 , 19.5 , 19.6 , 19.7 , 19.8 , 19.9 , 20.0 , 20.1 , 20.2 , 20.3 , 20.4 , 20.5 , 20.6 , 20.7 , 20.8 , 20.9 , 21.0 , 21.1 , 21.2 , 21.3 , 21.4 , 21.5 , 21.6 , 21.7 , 21.8 , 21.9 , 22.0 , 22.1 , 22.2 , 22.3 , 22.4 , 22.5 , 22.6 , 22.7 , 22.8 , 22.9 , 23.0 , 23.1 , 23.2 , 23.3 , 23.4 , 23.5 , 23.6 , 23.7 , 23.8 , 23.9 , 24.0 ] + occ1 = [ 5.49903483304 , 4.08265701586 , 10.025271142 , 17.6552033394 , 13.2237366115 , 5.47613895792 , 0.999758928022 , 1.58711989743 , 2.0055282384 , 2.1762483477 , 1.73805082226 , 0.925511037505 , 0.282112288671 , 0.995161099272 , 2.40809123039 , 0.705628833421 , 17.0599761833 , 10.1265743368 , 1.23352766927 , 1.66678462689 , 4.12599619707 , 4.20207804778 , 5.08359786969 , 3.37620211195 , 5.44981027191 , 2.60980002033 , 0.605548177339 , 1.62003962564 , 3.65787863662 , 5.44122935535 , 1.24536231033 , 4.97688619599 , 2.29404395639 , 16.5215749878 , 16.477812214 , 1.19479874357 , 1.94751724097 , 1.51747847861 , 1.51337594337 , 1.44757955587 , 9.07519900694 , 19.3205133236 , 20.694716424 , 0.449683376685 , 1.26411640809 , 2.10787602288 , 0.669587301723 , 0.634732322848 , 0.723407961919 , 1.89994612636 , 1.8721431028 , 0.825934537096 , 1.87151292795 , 3.19554801719 , 1.21571822811 , 0.635516491212 , 0.871681752366 , 0.347386594626 , 0.472373830237 , 0.532537463031 , 5.65389737685 , 1.34112885695 , 0.922471754123 , 2.94232225242 , 0.774735359774 , 0.645233042387 , 0.902233503422 , 2.06389199982 , 0.941009226952 , 4.7263331494 , 7.78727529189 , 28.4892345328 , 22.8343622882 , 0.454738553954 , 0.51763448394 , 0.629275560727 , 0.337179453659 , 0.394342062886 , 0.483797390261 , 0.481537033558 , 1.19820899855 ] + traf1 = [ 5.57239074764 , 3.94463027271 , 9.82187627072 , 17.6637747418 , 12.8078583137 , 4.98896303131 , 1.26044276869 , 0.761849528199 , 1.47718154615 , 1.99213178602 , 0.355741634508 , 0.442311675517 , 0.201809214452 , 0.365020546082 , 1.86369509938 , 1.21801716357 , 17.3881640899 , 10.0320657159 , 1.19726139889 , 0.571420452441 , 4.18142674465 , 4.31058266454 , 4.78018596297 , 3.28576012223 , 5.85050167165 , 2.70739575173 , 0.421337122472 , 0.496463139899 , 3.28355012424 , 5.34929069964 , 1.23804118318 , 5.1420406618 , 2.29927835034 , 16.6873265139 , 16.435394319 , 0.376377976438 , 2.72118541206 , 1.47441761914 , 1.34107164574 , 1.61090260254 , 8.87085478669 , 17.7458935979 , 27.6341018413 , 2.14146348178 , 1.13110076716 , 4.08295899489 , 0.65407135873 , 3.97976284942 , 3.14643530165 , 1.98292621383 , 4.61209657007 , 0.748269981314 , 1.58598371097 , 0.77671194209 , 0.285708092695 , 0.437693416825 , 0.925092915916 , 0.31978273665 , 0.403664081267 , 0.532834639837 , 0.4830288381 , 0.918549790777 , 0.761965852527 , 0.754987466884 , 0.439885758927 , 0.675604906839 , 0.835107677073 , 1.18418686689 , 0.84401725515 , 4.88466318727 , 7.63040683748 , 29.0859820268 , 22.6893571698 , 0.442177546547 , 0.523817661237 , 0.650807723773 , 0.340159154395 , 0.304019809615 , 0.426296869885 , 0.42629119812 , 0.426278103343 ] + ha1 = [ 5.89444444444 , 3.18777777778 , 7.46333333333 , 12.2277777778 , 10.2844444444 , 5.73333333333 , 2.99111111111 , 2.57888888889 , 1.78666666667 , 2.32666666667 , 1.96 , 3.97 , 2.43666666667 , 1.53333333333 , 1.89 , 3.62222222222 , 12.4722222222 , 8.70666666667 , 1.69333333333 , 1.95555555556 , 5.05 , 6.12 , 4.72222222222 , 3.77 , 4.95777777778 , 2.05555555556 , 0.568888888889 , 1.67777777778 , 3.78333333333 , 5.91666666667 , 4.59666666667 , 4.94666666667 , 3.41333333333 , 12.1044444444 , 13.5255555556 , 1.02444444444 , 2.25555555556 , 2.05888888889 , 2.31555555556 , 4.59666666667 , 11.9833333333 , 19.9788888889 , 25.1888888889 , 10.6177777778 , 19.3833333333 , 15.0088888889 , 15.6722222222 , 13.2555555556 , 16.0633333333 , 17.7844444444 , 20.9 , 14.3088888889 , 18.3566666667 , 10.78 , 4.71666666667 , 0.507777777778 , 0.907777777778 , 0.5 , 0.393333333333 , 0.724444444444 , 0.57 , 0.822222222222 , 0.903333333333 , 0.822222222222 , 0.57 , 0.726666666667 , 0.713333333333 , 0.762222222222 , 0.866666666667 , 3.43666666667 , 6.21888888889 , 20.6988888889 , 16.4911111111 , 0.646666666667 , 0.506666666667 , 0.613333333333 , 0.374444444444 , 0.343333333333 , 0.432222222222 , 0.432222222222 , 0.432222222222 ] + + time = [] + traf= [] + occ = [] + ha = [] + for time10 in range(160,240,10): + time01 = time10 / 10.0 + + for i in range(len(time1)): + if time1[i] == time01: + if time1[i] == 21: + print (traf1[i]-occ1[i])/traf1[i] + time.append(time1[i]) + traf.append(traf1[i]) + occ.append(occ1[i]) + ha.append(ha1[i]) + break + + time.append(time1[-1]) + traf.append(traf1[-1]) + occ.append(occ1[-1]) + ha.append(ha[-1]) + print 'MEAN - occ p: ',np.mean(occ) + print 'MEAN - occ t:', np.mean(traf) + print 'MEAN - traf t:', np.mean(ha) + + #xlim(20, 22) + ylim(0,23) + fig = plt.figure(1) + errorDis1 = plt.subplot(1,1,1) + ax=plt.gca() + for tick in ax.xaxis.get_major_ticks(): + tick.label1.set_fontsize(40) + for tick in ax.yaxis.get_major_ticks(): + tick.label1.set_fontsize(40) + errorDis1.set_xlabel('Time',size=50) + errorDis1.set_ylabel('MSE',size=50) + errorDis1.plot(time,ha,'^r--',label='TP-T', linewidth=lwidth, markersize=trisize,markerfacecolor='none',markeredgecolor='r',markeredgewidth=mewidth) + #errorDis1.plot(time,occ,'*r--',label='TPO-P', linewidth=2.5, markersize=40,markerfacecolor='r',markeredgecolor='r') + errorDis1.plot(time,traf,'pb-',label='TPO-T', linewidth = lwidth, markersize=psize,markerfacecolor='none',markeredgecolor='b',markeredgewidth=mewidth) + errorDis1.legend(bbox_to_anchor=(1, 1), prop={'size':legendsize}) + plt.grid(True, linewidth = gridwidth) + plt.show() + +elif graph == 33.2:#Lin Cheung - TPO-T VS TP-T +#TPO-T v.s. TP-T: MSE as a function of time (b) 20:00-22:00 + time1 = [ 16.0 , 16.1 , 16.2 , 16.3 , 16.4 , 16.5 , 16.6 , 16.7 , 16.8 , 16.9 , 17.0 , 17.1 , 17.2 , 17.3 , 17.4 , 17.5 , 17.6 , 17.7 , 17.8 , 17.9 , 18.0 , 18.1 , 18.2 , 18.3 , 18.4 , 18.5 , 18.6 , 18.7 , 18.8 , 18.9 , 19.0 , 19.1 , 19.2 , 19.3 , 19.4 , 19.5 , 19.6 , 19.7 , 19.8 , 19.9 , 20.0 , 20.1 , 20.2 , 20.3 , 20.4 , 20.5 , 20.6 , 20.7 , 20.8 , 20.9 , 21.0 , 21.1 , 21.2 , 21.3 , 21.4 , 21.5 , 21.6 , 21.7 , 21.8 , 21.9 , 22.0 , 22.1 , 22.2 , 22.3 , 22.4 , 22.5 , 22.6 , 22.7 , 22.8 , 22.9 , 23.0 , 23.1 , 23.2 , 23.3 , 23.4 , 23.5 , 23.6 , 23.7 , 23.8 , 23.9 , 24.0 ] + occ1 = [ 5.49903483304 , 4.08265701586 , 10.025271142 , 17.6552033394 , 13.2237366115 , 5.47613895792 , 0.999758928022 , 1.58711989743 , 2.0055282384 , 2.1762483477 , 1.73805082226 , 0.925511037505 , 0.282112288671 , 0.995161099272 , 2.40809123039 , 0.705628833421 , 17.0599761833 , 10.1265743368 , 1.23352766927 , 1.66678462689 , 4.12599619707 , 4.20207804778 , 5.08359786969 , 3.37620211195 , 5.44981027191 , 2.60980002033 , 0.605548177339 , 1.62003962564 , 3.65787863662 , 5.44122935535 , 1.24536231033 , 4.97688619599 , 2.29404395639 , 16.5215749878 , 16.477812214 , 1.19479874357 , 1.94751724097 , 1.51747847861 , 1.51337594337 , 1.44757955587 , 9.07519900694 , 19.3205133236 , 20.694716424 , 0.449683376685 , 1.26411640809 , 2.10787602288 , 0.669587301723 , 0.634732322848 , 0.723407961919 , 1.89994612636 , 1.8721431028 , 0.825934537096 , 1.87151292795 , 3.19554801719 , 1.21571822811 , 0.635516491212 , 0.871681752366 , 0.347386594626 , 0.472373830237 , 0.532537463031 , 5.65389737685 , 1.34112885695 , 0.922471754123 , 2.94232225242 , 0.774735359774 , 0.645233042387 , 0.902233503422 , 2.06389199982 , 0.941009226952 , 4.7263331494 , 7.78727529189 , 28.4892345328 , 22.8343622882 , 0.454738553954 , 0.51763448394 , 0.629275560727 , 0.337179453659 , 0.394342062886 , 0.483797390261 , 0.481537033558 , 1.19820899855 ] + traf1 = [ 5.57239074764 , 3.94463027271 , 9.82187627072 , 17.6637747418 , 12.8078583137 , 4.98896303131 , 1.26044276869 , 0.761849528199 , 1.47718154615 , 1.99213178602 , 0.355741634508 , 0.442311675517 , 0.201809214452 , 0.365020546082 , 1.86369509938 , 1.21801716357 , 17.3881640899 , 10.0320657159 , 1.19726139889 , 0.571420452441 , 4.18142674465 , 4.31058266454 , 4.78018596297 , 3.28576012223 , 5.85050167165 , 2.70739575173 , 0.421337122472 , 0.496463139899 , 3.28355012424 , 5.34929069964 , 1.23804118318 , 5.1420406618 , 2.29927835034 , 16.6873265139 , 16.435394319 , 0.376377976438 , 2.72118541206 , 1.47441761914 , 1.34107164574 , 1.61090260254 , 8.87085478669 , 17.7458935979 , 27.6341018413 , 2.14146348178 , 1.13110076716 , 4.08295899489 , 0.65407135873 , 3.97976284942 , 3.14643530165 , 1.98292621383 , 4.61209657007 , 0.748269981314 , 1.58598371097 , 0.77671194209 , 0.285708092695 , 0.437693416825 , 0.925092915916 , 0.31978273665 , 0.403664081267 , 0.532834639837 , 0.4830288381 , 0.918549790777 , 0.761965852527 , 0.754987466884 , 0.439885758927 , 0.675604906839 , 0.835107677073 , 1.18418686689 , 0.84401725515 , 4.88466318727 , 7.63040683748 , 29.0859820268 , 22.6893571698 , 0.442177546547 , 0.523817661237 , 0.650807723773 , 0.340159154395 , 0.304019809615 , 0.426296869885 , 0.42629119812 , 0.426278103343 ] + ha1 = [ 5.89444444444 , 3.18777777778 , 7.46333333333 , 12.2277777778 , 10.2844444444 , 5.73333333333 , 2.99111111111 , 2.57888888889 , 1.78666666667 , 2.32666666667 , 1.96 , 3.97 , 2.43666666667 , 1.53333333333 , 1.89 , 3.62222222222 , 12.4722222222 , 8.70666666667 , 1.69333333333 , 1.95555555556 , 5.05 , 6.12 , 4.72222222222 , 3.77 , 4.95777777778 , 2.05555555556 , 0.568888888889 , 1.67777777778 , 3.78333333333 , 5.91666666667 , 4.59666666667 , 4.94666666667 , 3.41333333333 , 12.1044444444 , 13.5255555556 , 1.02444444444 , 2.25555555556 , 2.05888888889 , 2.31555555556 , 4.59666666667 , 11.9833333333 , 19.9788888889 , 25.1888888889 , 10.6177777778 , 19.3833333333 , 15.0088888889 , 15.6722222222 , 13.2555555556 , 16.0633333333 , 17.7844444444 , 20.9 , 14.3088888889 , 18.3566666667 , 10.78 , 4.71666666667 , 0.507777777778 , 0.907777777778 , 0.5 , 0.393333333333 , 0.724444444444 , 0.57 , 0.822222222222 , 0.903333333333 , 0.822222222222 , 0.57 , 0.726666666667 , 0.713333333333 , 0.762222222222 , 0.866666666667 , 3.43666666667 , 6.21888888889 , 20.6988888889 , 16.4911111111 , 0.646666666667 , 0.506666666667 , 0.613333333333 , 0.374444444444 , 0.343333333333 , 0.432222222222 , 0.432222222222 , 0.432222222222 ] + + time = [] + traf= [] + occ = [] + ha = [] + for time10 in range(160,240,1): + time01 = time10 / 10.0 + + for i in range(len(time1)): + if time1[i] == time01: + if time1[i] == 21: + print (traf1[i]-occ1[i])/traf1[i] + time.append(time1[i]) + traf.append(traf1[i]) + occ.append(occ1[i]) + ha.append(ha1[i]) + break + + time.append(time1[-1]) + traf.append(traf1[-1]) + occ.append(occ1[-1]) + ha.append(ha[-1]) + print 'MEAN - occ p: ',np.mean(occ) + print 'MEAN - occ t:', np.mean(traf) + print 'MEAN - traf t:', np.mean(ha) + + xlim(20, 22) + ylim(0,30) + fig = plt.figure(1) + errorDis1 = plt.subplot(1,1,1) + ax=plt.gca() + for tick in ax.xaxis.get_major_ticks(): + tick.label1.set_fontsize(xfontsize) + for tick in ax.yaxis.get_major_ticks(): + tick.label1.set_fontsize(yfontsize) + errorDis1.set_xlabel('Time',size=xlabelsize) + errorDis1.set_ylabel('MSE',size=ylabelsize) + errorDis1.plot(time,ha,'^r--',label='TP-T', linewidth=lwidth, markersize=trisize,markerfacecolor='none',markeredgecolor='r',markeredgewidth=mewidth) + #errorDis1.plot(time,occ,'*r--',label='TPO-P', linewidth=2.5, markersize=40,markerfacecolor='r',markeredgecolor='r') + errorDis1.plot(time,traf,'pb-',label='TPO-T', linewidth = lwidth, markersize=psize,markerfacecolor='none',markeredgecolor='b',markeredgewidth=mewidth) + errorDis1.legend(bbox_to_anchor=(1, 1), prop={'size':legendsize}) + plt.grid(True, linewidth = lwidth) + plt.show() +elif graph == 34:#Lin Cheung - TPO-T VS TPO-P +#TPO-T v.s. TPO-P: MSE as a function of time. + time1 = [ 16.0 , 16.1 , 16.2 , 16.3 , 16.4 , 16.5 , 16.6 , 16.7 , 16.8 , 16.9 , 17.0 , 17.1 , 17.2 , 17.3 , 17.4 , 17.5 , 17.6 , 17.7 , 17.8 , 17.9 , 18.0 , 18.1 , 18.2 , 18.3 , 18.4 , 18.5 , 18.6 , 18.7 , 18.8 , 18.9 , 19.0 , 19.1 , 19.2 , 19.3 , 19.4 , 19.5 , 19.6 , 19.7 , 19.8 , 19.9 , 20.0 , 20.1 , 20.2 , 20.3 , 20.4 , 20.5 , 20.6 , 20.7 , 20.8 , 20.9 , 21.0 , 21.1 , 21.2 , 21.3 , 21.4 , 21.5 , 21.6 , 21.7 , 21.8 , 21.9 , 22.0 , 22.1 , 22.2 , 22.3 , 22.4 , 22.5 , 22.6 , 22.7 , 22.8 , 22.9 , 23.0 , 23.1 , 23.2 , 23.3 , 23.4 , 23.5 , 23.6 , 23.7 , 23.8 , 23.9 , 24.0 ] + occ1 = [ 5.49903483304 , 4.08265701586 , 10.025271142 , 17.6552033394 , 13.2237366115 , 5.47613895792 , 0.999758928022 , 1.58711989743 , 2.0055282384 , 2.1762483477 , 1.73805082226 , 0.925511037505 , 0.282112288671 , 0.995161099272 , 2.40809123039 , 0.705628833421 , 17.0599761833 , 10.1265743368 , 1.23352766927 , 1.66678462689 , 4.12599619707 , 4.20207804778 , 5.08359786969 , 3.37620211195 , 5.44981027191 , 2.60980002033 , 0.605548177339 , 1.62003962564 , 3.65787863662 , 5.44122935535 , 1.24536231033 , 4.97688619599 , 2.29404395639 , 16.5215749878 , 16.477812214 , 1.19479874357 , 1.94751724097 , 1.51747847861 , 1.51337594337 , 1.44757955587 , 9.07519900694 , 19.3205133236 , 20.694716424 , 0.449683376685 , 1.26411640809 , 2.10787602288 , 0.669587301723 , 0.634732322848 , 0.723407961919 , 1.89994612636 , 1.8721431028 , 0.825934537096 , 1.87151292795 , 3.19554801719 , 1.21571822811 , 0.635516491212 , 0.871681752366 , 0.347386594626 , 0.472373830237 , 0.532537463031 , 5.65389737685 , 1.34112885695 , 0.922471754123 , 2.94232225242 , 0.774735359774 , 0.645233042387 , 0.902233503422 , 2.06389199982 , 0.941009226952 , 4.7263331494 , 7.78727529189 , 28.4892345328 , 22.8343622882 , 0.454738553954 , 0.51763448394 , 0.629275560727 , 0.337179453659 , 0.394342062886 , 0.483797390261 , 0.481537033558 , 1.19820899855 ] + traf1 = [ 5.57239074764 , 3.94463027271 , 9.82187627072 , 17.6637747418 , 12.8078583137 , 4.98896303131 , 1.26044276869 , 0.761849528199 , 1.47718154615 , 1.99213178602 , 0.355741634508 , 0.442311675517 , 0.201809214452 , 0.365020546082 , 1.86369509938 , 1.21801716357 , 17.3881640899 , 10.0320657159 , 1.19726139889 , 0.571420452441 , 4.18142674465 , 4.31058266454 , 4.78018596297 , 3.28576012223 , 5.85050167165 , 2.70739575173 , 0.421337122472 , 0.496463139899 , 3.28355012424 , 5.34929069964 , 1.23804118318 , 5.1420406618 , 2.29927835034 , 16.6873265139 , 16.435394319 , 0.376377976438 , 2.72118541206 , 1.47441761914 , 1.34107164574 , 1.61090260254 , 8.87085478669 , 17.7458935979 , 27.6341018413 , 2.14146348178 , 1.13110076716 , 4.08295899489 , 0.65407135873 , 3.97976284942 , 3.14643530165 , 1.98292621383 , 4.61209657007 , 0.748269981314 , 1.58598371097 , 0.77671194209 , 0.285708092695 , 0.437693416825 , 0.925092915916 , 0.31978273665 , 0.403664081267 , 0.532834639837 , 0.4830288381 , 0.918549790777 , 0.761965852527 , 0.754987466884 , 0.439885758927 , 0.675604906839 , 0.835107677073 , 1.18418686689 , 0.84401725515 , 4.88466318727 , 7.63040683748 , 29.0859820268 , 22.6893571698 , 0.442177546547 , 0.523817661237 , 0.650807723773 , 0.340159154395 , 0.304019809615 , 0.426296869885 , 0.42629119812 , 0.426278103343 ] + ha1 = [ 5.89444444444 , 3.18777777778 , 7.46333333333 , 12.2277777778 , 10.2844444444 , 5.73333333333 , 2.99111111111 , 2.57888888889 , 1.78666666667 , 2.32666666667 , 1.96 , 3.97 , 2.43666666667 , 1.53333333333 , 1.89 , 3.62222222222 , 12.4722222222 , 8.70666666667 , 1.69333333333 , 1.95555555556 , 5.05 , 6.12 , 4.72222222222 , 3.77 , 4.95777777778 , 2.05555555556 , 0.568888888889 , 1.67777777778 , 3.78333333333 , 5.91666666667 , 4.59666666667 , 4.94666666667 , 3.41333333333 , 12.1044444444 , 13.5255555556 , 1.02444444444 , 2.25555555556 , 2.05888888889 , 2.31555555556 , 4.59666666667 , 11.9833333333 , 19.9788888889 , 25.1888888889 , 10.6177777778 , 19.3833333333 , 15.0088888889 , 15.6722222222 , 13.2555555556 , 16.0633333333 , 17.7844444444 , 20.9 , 14.3088888889 , 18.3566666667 , 10.78 , 4.71666666667 , 0.507777777778 , 0.907777777778 , 0.5 , 0.393333333333 , 0.724444444444 , 0.57 , 0.822222222222 , 0.903333333333 , 0.822222222222 , 0.57 , 0.726666666667 , 0.713333333333 , 0.762222222222 , 0.866666666667 , 3.43666666667 , 6.21888888889 , 20.6988888889 , 16.4911111111 , 0.646666666667 , 0.506666666667 , 0.613333333333 , 0.374444444444 , 0.343333333333 , 0.432222222222 , 0.432222222222 , 0.432222222222 ] + + time = [] + traf= [] + occ = [] + ha = [] + for time10 in range(160,240,10): + time01 = time10 / 10.0 + + for i in range(len(time1)): + if time1[i] == time01: + if time1[i] == 21: + print (traf1[i]-occ1[i])/traf1[i] + time.append(time1[i]) + traf.append(traf1[i]) + occ.append(occ1[i]) + ha.append(ha1[i]) + break + + time.append(time1[-1]) + traf.append(traf1[-1]) + occ.append(occ1[-1]) + ha.append(ha[-1]) + print 'MEAN - occ p: ',np.mean(occ) + print 'MEAN - occ t:', np.mean(traf) + #print 'MEAN - traf t:', np.mean(ha) + + #xlim(20, 22) + ylim(0,12) + fig = plt.figure(1) + errorDis1 = plt.subplot(1,1,1) + ax=plt.gca() + for tick in ax.xaxis.get_major_ticks(): + tick.label1.set_fontsize(xfontsize) + for tick in ax.yaxis.get_major_ticks(): + tick.label1.set_fontsize(yfontsize) + errorDis1.set_xlabel('Time',size=xlabelsize) + errorDis1.set_ylabel('MSE',size=ylabelsize) + #errorDis1.plot(time,ha,'.b--',label='TP-T', linewidth=2.5, markersize=60,markerfacecolor='b',markeredgecolor='b') + errorDis1.plot(time,occ,'pb--',label='TPO-P', linewidth=lwidth, markersize=psize,markerfacecolor='none',markeredgecolor='b',markeredgewidth=mewidth) + errorDis1.plot(time,traf,'or-',label='TPO-T', linewidth = lwidth, markersize=osize,markerfacecolor='none',markeredgecolor='r',markeredgewidth=mewidth) + errorDis1.legend(bbox_to_anchor=(1, 1), prop={'size':legendsize}) + plt.grid(True, linewidth = gridwidth) + plt.show() + +elif graph == 35:#Lin Cheung - TPO-P VS TP-P, 3 months training, 1 months testing +#TPO-P v.s. TP-P: MSE as a function of time 1624 + time1 = [ 16.0 , 16.1 , 16.2 , 16.3 , 16.4 , 16.5 , 16.6 , 16.7 , 16.8 , 16.9 , 17.0 , 17.1 , 17.2 , 17.3 , 17.4 , 17.5 , 17.6 , 17.7 , 17.8 , 17.9 , 18.0 , 18.1 , 18.2 , 18.3 , 18.4 , 18.5 , 18.6 , 18.7 , 18.8 , 18.9 , 19.0 , 19.1 , 19.2 , 19.3 , 19.4 , 19.5 , 19.6 , 19.7 , 19.8 , 19.9 , 20.0 , 20.1 , 20.2 , 20.3 , 20.4 , 20.5 , 20.6 , 20.7 , 20.8 , 20.9 , 21.0 , 21.1 , 21.2 , 21.3 , 21.4 , 21.5 , 21.6 , 21.7 , 21.8 , 21.9 , 22.0 , 22.1 , 22.2 , 22.3 , 22.4 , 22.5 , 22.6 , 22.7 , 22.8 , 22.9 , 23.0 , 23.1 , 23.2 , 23.3 , 23.4 , 23.5 , 23.6 , 23.7 , 23.8 , 23.9 , 24.0 ] + occ1 = [ 5.49903483304 , 4.08265701586 , 10.025271142 , 17.6552033394 , 13.2237366115 , 5.47613895792 , 0.999758928022 , 1.58711989743 , 2.0055282384 , 2.1762483477 , 1.73805082226 , 0.925511037505 , 0.282112288671 , 0.995161099272 , 2.40809123039 , 0.705628833421 , 17.0599761833 , 10.1265743368 , 1.23352766927 , 1.66678462689 , 4.12599619707 , 4.20207804778 , 5.08359786969 , 3.37620211195 , 5.44981027191 , 2.60980002033 , 0.605548177339 , 1.62003962564 , 3.65787863662 , 5.44122935535 , 1.24536231033 , 4.97688619599 , 2.29404395639 , 16.5215749878 , 16.477812214 , 1.19479874357 , 1.94751724097 , 1.51747847861 , 1.51337594337 , 1.44757955587 , 9.07519900694 , 19.3205133236 , 20.694716424 , 0.449683376685 , 1.26411640809 , 2.10787602288 , 0.669587301723 , 0.634732322848 , 0.723407961919 , 1.89994612636 , 1.8721431028 , 0.825934537096 , 1.87151292795 , 3.19554801719 , 1.21571822811 , 0.635516491212 , 0.871681752366 , 0.347386594626 , 0.472373830237 , 0.532537463031 , 5.65389737685 , 1.34112885695 , 0.922471754123 , 2.94232225242 , 0.774735359774 , 0.645233042387 , 0.902233503422 , 2.06389199982 , 0.941009226952 , 4.7263331494 , 7.78727529189 , 28.4892345328 , 22.8343622882 , 0.454738553954 , 0.51763448394 , 0.629275560727 , 0.337179453659 , 0.394342062886 , 0.483797390261 , 0.481537033558 , 1.19820899855 ] + traf1 = [ 5.67034912902 , 3.4439361993 , 7.41826198014 , 12.2542358573 , 9.28203790162 , 5.86881015359 , 2.74121015261 , 2.43203836572 , 1.56769559353 , 2.29906347435 , 2.19519642645 , 3.76270787453 , 2.60791922839 , 1.93977440675 , 2.22490763293 , 2.1285169511 , 12.0268924432 , 8.75495020281 , 1.51164982502 , 1.7262822417 , 3.69702882167 , 5.17441326713 , 3.91906176782 , 3.24130229581 , 4.36181903615 , 2.06036518521 , 0.863133464832 , 1.88208246395 , 3.79041757886 , 6.08279658256 , 4.64154595031 , 5.09382003718 , 3.59051814473 , 11.7662128781 , 13.3825697739 , 1.04480363183 , 1.75460440286 , 1.92492904929 , 2.35518835321 , 4.39700066378 , 10.5874467744 , 19.0551710251 , 22.02362077 , 10.7710691987 , 25.3702078592 , 13.8407086908 , 11.7838011769 , 9.45152399524 , 7.67663240032 , 3.53185195857 , 6.26581398446 , 10.2999464928 , 27.4767195669 , 1.20030632239 , 1.06412381931 , 0.75215874301 , 0.797127220553 , 0.418335430494 , 0.387485269692 , 0.746547344465 , 2.30934764997 , 1.13401107389 , 1.18226625051 , 2.4639587413 , 1.03275962596 , 1.04058915034 , 1.02561195806 , 0.717555965534 , 0.752406516688 , 3.35712889926 , 6.13955660405 , 20.7402572695 , 16.4197585943 , 0.647778847426 , 0.500274852399 , 0.612234609617 , 0.396466438523 , 0.328438554444 , 0.458621687999 , 0.457650006252 , 0.781134210783 ] + + time = [] + traf= [] + occ = [] + for time10 in range(160,240,10): + time01 = time10 / 10.0 + for i in range(len(time1)): + if time1[i] == time01: + if time1[i] == 21.2: + print traf1[i], occ1[i] + print (traf1[i]-occ1[i])/traf1[i] + time.append(time1[i]) + traf.append(traf1[i]) + occ.append(occ1[i]) + break + + time.append(time1[-1]) + traf.append(traf1[-1]) + occ.append(occ1[-1]) + print 'MEAN - occ: ',np.mean(occ) + print 'MEAN - traf:', np.mean(traf) + + xlim(16, 24) + ylim(0,12) + fig = plt.figure(1) + errorDis1 = plt.subplot(1,1,1) + ax=plt.gca() + for tick in ax.xaxis.get_major_ticks(): + tick.label1.set_fontsize(xfontsize) + for tick in ax.yaxis.get_major_ticks(): + tick.label1.set_fontsize(yfontsize) + errorDis1.set_xlabel('Time',size=xlabelsize) + errorDis1.set_ylabel('MSE',size=ylabelsize) + errorDis1.plot(time,occ,'ob-',label='TPO-P', linewidth=lwidth, markersize=osize,markerfacecolor='none',markeredgecolor='b',markeredgewidth=mewidth) + errorDis1.plot(time,traf,'*r--',label='TP-P', linewidth = lwidth, markersize=starsize,markerfacecolor='none',markeredgecolor='r',markeredgewidth=mewidth) + errorDis1.legend(bbox_to_anchor=(1, 1), prop={'size':legendsize}) + plt.grid(True, linewidth = gridwidth) + plt.show() +elif graph == 35.1:#Lin Cheung - TPO-P VS TP-P, 3 months training, 1 months testing +#TPO-P v.s. TP-P: MSE as a function of time 2022 + time1 = [ 16.0 , 16.1 , 16.2 , 16.3 , 16.4 , 16.5 , 16.6 , 16.7 , 16.8 , 16.9 , 17.0 , 17.1 , 17.2 , 17.3 , 17.4 , 17.5 , 17.6 , 17.7 , 17.8 , 17.9 , 18.0 , 18.1 , 18.2 , 18.3 , 18.4 , 18.5 , 18.6 , 18.7 , 18.8 , 18.9 , 19.0 , 19.1 , 19.2 , 19.3 , 19.4 , 19.5 , 19.6 , 19.7 , 19.8 , 19.9 , 20.0 , 20.1 , 20.2 , 20.3 , 20.4 , 20.5 , 20.6 , 20.7 , 20.8 , 20.9 , 21.0 , 21.1 , 21.2 , 21.3 , 21.4 , 21.5 , 21.6 , 21.7 , 21.8 , 21.9 , 22.0 , 22.1 , 22.2 , 22.3 , 22.4 , 22.5 , 22.6 , 22.7 , 22.8 , 22.9 , 23.0 , 23.1 , 23.2 , 23.3 , 23.4 , 23.5 , 23.6 , 23.7 , 23.8 , 23.9 , 24.0 ] + occ1 = [ 5.49903483304 , 4.08265701586 , 10.025271142 , 17.6552033394 , 13.2237366115 , 5.47613895792 , 0.999758928022 , 1.58711989743 , 2.0055282384 , 2.1762483477 , 1.73805082226 , 0.925511037505 , 0.282112288671 , 0.995161099272 , 2.40809123039 , 0.705628833421 , 17.0599761833 , 10.1265743368 , 1.23352766927 , 1.66678462689 , 4.12599619707 , 4.20207804778 , 5.08359786969 , 3.37620211195 , 5.44981027191 , 2.60980002033 , 0.605548177339 , 1.62003962564 , 3.65787863662 , 5.44122935535 , 1.24536231033 , 4.97688619599 , 2.29404395639 , 16.5215749878 , 16.477812214 , 1.19479874357 , 1.94751724097 , 1.51747847861 , 1.51337594337 , 1.44757955587 , 9.07519900694 , 19.3205133236 , 20.694716424 , 0.449683376685 , 1.26411640809 , 2.10787602288 , 0.669587301723 , 0.634732322848 , 0.723407961919 , 1.89994612636 , 1.8721431028 , 0.825934537096 , 1.87151292795 , 3.19554801719 , 1.21571822811 , 0.635516491212 , 0.871681752366 , 0.347386594626 , 0.472373830237 , 0.532537463031 , 5.65389737685 , 1.34112885695 , 0.922471754123 , 2.94232225242 , 0.774735359774 , 0.645233042387 , 0.902233503422 , 2.06389199982 , 0.941009226952 , 4.7263331494 , 7.78727529189 , 28.4892345328 , 22.8343622882 , 0.454738553954 , 0.51763448394 , 0.629275560727 , 0.337179453659 , 0.394342062886 , 0.483797390261 , 0.481537033558 , 1.19820899855 ] + traf1 = [ 5.67034912902 , 3.4439361993 , 7.41826198014 , 12.2542358573 , 9.28203790162 , 5.86881015359 , 2.74121015261 , 2.43203836572 , 1.56769559353 , 2.29906347435 , 2.19519642645 , 3.76270787453 , 2.60791922839 , 1.93977440675 , 2.22490763293 , 2.1285169511 , 12.0268924432 , 8.75495020281 , 1.51164982502 , 1.7262822417 , 3.69702882167 , 5.17441326713 , 3.91906176782 , 3.24130229581 , 4.36181903615 , 2.06036518521 , 0.863133464832 , 1.88208246395 , 3.79041757886 , 6.08279658256 , 4.64154595031 , 5.09382003718 , 3.59051814473 , 11.7662128781 , 13.3825697739 , 1.04480363183 , 1.75460440286 , 1.92492904929 , 2.35518835321 , 4.39700066378 , 10.5874467744 , 19.0551710251 , 22.02362077 , 10.7710691987 , 25.3702078592 , 13.8407086908 , 11.7838011769 , 9.45152399524 , 7.67663240032 , 3.53185195857 , 6.26581398446 , 10.2999464928 , 27.4767195669 , 1.20030632239 , 1.06412381931 , 0.75215874301 , 0.797127220553 , 0.418335430494 , 0.387485269692 , 0.746547344465 , 2.30934764997 , 1.13401107389 , 1.18226625051 , 2.4639587413 , 1.03275962596 , 1.04058915034 , 1.02561195806 , 0.717555965534 , 0.752406516688 , 3.35712889926 , 6.13955660405 , 20.7402572695 , 16.4197585943 , 0.647778847426 , 0.500274852399 , 0.612234609617 , 0.396466438523 , 0.328438554444 , 0.458621687999 , 0.457650006252 , 0.781134210783 ] + + time = [] + traf= [] + occ = [] + for time10 in range(200,220,1): + time01 = time10 / 10.0 + for i in range(len(time1)): + if time1[i] == time01: + if time1[i] == 21.2: + print traf1[i], occ1[i] + print (traf1[i]-occ1[i])/traf1[i] + time.append(time1[i]) + traf.append(traf1[i]) + occ.append(occ1[i]) + break + + time.append(time1[-1]) + traf.append(traf1[-1]) + occ.append(occ1[-1]) + print 'MEAN - occ: ',np.mean(occ) + print 'MEAN - traf:', np.mean(traf) + + xlim(20, 22) + #ylim(0,20) + fig = plt.figure(1) + errorDis1 = plt.subplot(1,1,1) + ax=plt.gca() + for tick in ax.xaxis.get_major_ticks(): + tick.label1.set_fontsize(xfontsize) + for tick in ax.yaxis.get_major_ticks(): + tick.label1.set_fontsize(yfontsize) + errorDis1.set_xlabel('Time',size=xlabelsize) + errorDis1.set_ylabel('MSE',size=ylabelsize) + errorDis1.plot(time,occ,'ob-',label='TPO-P', linewidth=lwidth, markersize=osize,markerfacecolor='none',markeredgecolor='b',markeredgewidth=mewidth) + errorDis1.plot(time,traf,'*r--',label='TP-P', linewidth = lwidth, markersize=starsize,markerfacecolor='none',markeredgecolor='r',markeredgewidth=mewidth) + errorDis1.legend(bbox_to_anchor=(1, 1), prop={'size':legendsize}) + plt.grid(True, linewidth = gridwidth) + plt.show() + if graph == 1: a = 1 -#if graph == 1:#TFO-PT VS TF-P in EV, 3 months training, 1 month testing +#if graph == 1:#TPO-PT VS TP-P in EV, 3 months training, 1 month testing # time = [20.0, 20.1, 20.2, 20.3, 20.4, 20.5, 20.6, 20.7, 20.8, 20.9, 21.0, 21.1, 21.2, 21.3, 21.4, 21.5, 21.6, 21.7, 21.8,21.9,22.0] # occ = [4.43856361049, 3.45269221205, 1.9894396961, 1.9407839505, 3.34191535315, 2.47722156475, 1.82952567828, 1.2440208276, 1.20274150027, 2.27107805172, 2.64679454419, 2.10666487984, 2.73142001716, 1.4004144278, 4.88139748, 4.64862957209, 1.94741566563, 3.32108394665, 5.01034076233, 1.90099875357, 3.14829617202] # ha = [4.89016012678, 4.0033745933, 2.76519358429, 1.44947016868, 4.72180045316, 3.88661818338, 1.43312481824, 1.35107883556, 1.7456964458, 2.6674446706, 5.48747918328, 4.49054716774, 4.09614888051, 4.69560730652, 4.65258696117, 3.88204650803, 2.83935676091, 4.5961029574, 4.59945065179, 2.17088625344, 3.9071037946] @@ -112,12 +1020,12 @@ def AutoLocatorInit(self): # tick.label1.set_fontsize(40) # errorDis1.set_xlabel('time',size=50) # errorDis1.set_ylabel('MSE',size=50) -# errorDis1.plot(time,ha,'*r--',label='TF-P', linewidth=2.5, markersize=25,markerfacecolor='r',markeredgecolor='r') -# errorDis1.plot(time,occ,'sk-',label='TFO-PT', linewidth = 2.5, markersize=20,markerfacecolor='k',markeredgecolor='k') +# errorDis1.plot(time,ha,'*r--',label='TP-P', linewidth=2.5, markersize=25,markerfacecolor='r',markeredgecolor='r') +# errorDis1.plot(time,occ,'sk-',label='TPO-PT', linewidth = 2.5, markersize=20,markerfacecolor='k',markeredgecolor='k') # # errorDis1.legend(bbox_to_anchor=(0.37, 1), loc=0, borderaxespad=0.,prop={'size':40}) # plt.show() -#elif graph == 2:#TFO-TT VS TF-T in EV, 1 months training, 3 months testing +#elif graph == 2:#TPO-TT VS TP-T in EV, 1 months training, 3 months testing # time = [20.0, 20.1, 20.2, 20.3, 20.4, 20.5, 20.6, 20.7, 20.8, 20.9, 21.0, 21.1, 21.2, 21.3, 21.4, 21.5, 21.6, 21.7, 21.8,21.9,22.0] # occ = [6.53713071169, 3.6100915748, 2.98813230058, 2.04783764553, 2.60001717019, 1.67795651189, 2.92481559366, 1.78590828584, 0.883847519117, 2.09792479628, 2.77275673653, 6.82743125648, 2.05469069428, 2.51612903226, 5.88560779047, 3.49943148138, 2.40634975286, 3.52572148133, 25.2955480928, 1.86695266159, 12.08213843] # ha = [5.68783694938, 5.93011176857, 6.64806048652, 5.23185404339, 16.66617357, 9.43609467456, 2.10019723866, 2.68957922419, 4.42330703485, 9.30023011177, 10.2113412229, 7.99375410914, 8.58267587114, 10.5413872452, 5.42728468113, 6.30785667324, 8.48868265988, 9.88826240799, 8.60621301775, 4.16111111111, 5.93625904011] @@ -144,8 +1052,8 @@ def AutoLocatorInit(self): # tick.label1.set_fontsize(45) # errorDis1.set_xlabel('time',size=45) # errorDis1.set_ylabel('MSE',size=45) -# errorDis1.plot(time,ha,'*r--',label='TFO-TT', linewidth=2.5, markersize=25,markerfacecolor='r',markeredgecolor='r') -# errorDis1.plot(time,occ,'sk-',label='TF-T', linewidth = 2.5, markersize=20,markerfacecolor='k',markeredgecolor='k') +# errorDis1.plot(time,ha,'*r--',label='TPO-TT', linewidth=2.5, markersize=25,markerfacecolor='r',markeredgecolor='r') +# errorDis1.plot(time,occ,'sk-',label='TP-T', linewidth = 2.5, markersize=20,markerfacecolor='k',markeredgecolor='k') # errorDis1.legend(bbox_to_anchor=(0.47, 1), loc=0, borderaxespad=0.,prop={'size':45}) # plt.show() elif graph == 3:#different areas @@ -168,6 +1076,7 @@ def AutoLocatorInit(self): #errorDis1.plot(area,corrWk,'^b--',label='corr rand in weekend',markersize=36,markerfacecolor='w',markeredgecolor='b') xlim(-5,150) errorDis1.legend(bbox_to_anchor=(0.47, 1), loc=0, borderaxespad=0.,prop={'size':40}) + plt.grid(True, linewidth = 3) plt.show() #elif graph == 4:#LWR-O VS HA-T in AN & EV, 1 months training, 3 months testing ## print "time=[", @@ -258,7 +1167,49 @@ def AutoLocatorInit(self): # errorDis1.plot(time,stdo,'ok-',label='SparseT-DenseO', markersize=9,markerfacecolor='w',markeredgecolor='k') # errorDis1.legend(prop={'size':45}) # plt.show() -elif graph == 7:#O versus T - TFO-T VS TFO-P VS TF-T +#elif graph == 7:#O versus T - TPO-T VS TPO-P VS TP-T +## time1 = [ 6.0 , 6.1 , 6.2 , 6.3 , 6.4 , 6.5 , 6.6 , 6.7 , 6.8 , 6.9 , 7.0 , 7.1 , 7.2 , 7.3 , 7.4 , 7.5 , 7.6 , 7.7 , 7.8 , 7.9 , 8.0 , 8.1 , 8.2 , 8.3 , 8.4 , 8.5 , 8.6 , 8.7 , 8.8 , 8.9 , 9.0 , 9.1 , 9.2 , 9.3 , 9.4 , 9.5 , 9.6 , 9.7 , 9.8 , 9.9 , 10.0 , 10.1 , 10.2 , 10.3 , 10.4 , 10.5 , 10.6 , 10.7 , 10.8 , 10.9 , 11.0 , 11.1 , 11.2 , 11.3 , 11.4 , 11.5 , 11.6 , 11.7 , 11.8 , 11.9 , 12.0 , 12.1 , 12.2 , 12.3 , 12.4 , 12.5 , 12.6 , 12.7 , 12.8 , 12.9 , 13.0 , 13.1 , 13.2 , 13.3 , 13.4 , 13.5 , 13.6 , 13.7 , 13.8 , 13.9 , 14.0 , 14.1 , 14.2 , 14.3 , 14.4 , 14.5 , 14.6 , 14.7 , 14.8 , 14.9 , 15.0 , 15.1 , 15.2 , 15.3 , 15.4 , 15.5 , 15.6 , 15.7 , 15.8 , 15.9 , 16.0 , 16.1 , 16.2 , 16.3 , 16.4 , 16.5 , 16.6 , 16.7 , 16.8 , 16.9 , 17.0 , 17.1 , 17.2 , 17.3 , 17.4 , 17.5 , 17.6 , 17.7 , 17.8 , 17.9 , 18.0 , 18.1 , 18.2 , 18.3 , 18.4 , 18.5 , 18.6 , 18.7 , 18.8 , 18.9 , 19.0 , 19.1 , 19.2 , 19.3 , 19.4 , 19.5 , 19.6 , 19.7 , 19.8 , 19.9 , 20.0 , 20.1 , 20.2 , 20.3 , 20.4 , 20.5 , 20.6 , 20.7 , 20.8 , 20.9 , 21.0 , 21.1 , 21.2 , 21.3 , 21.4 , 21.5 , 21.6 , 21.7 , 21.8 , 21.9 , 22.0 ] +## oftt1 = [ 2.24145459457 , 1.73143800808 , 0.799179426583 , 2.01173649785 , 1.81718487406 , 1.15549025585 , 2.81841446511 , 1.31058908497 , 1.10303421876 , 0.645413892646 , 2.58626674665 , 3.61801909886 , 0.952661481413 , 1.33722863725 , 2.33427913521 , 3.25891430085 , 1.58177500317 , 3.16742183238 , 3.40244886268 , 2.74782217877 , 2.02421508291 , 3.43543221065 , 2.75801727099 , 3.47512377666 , 3.21835103328 , 3.55187074828 , 2.58031331124 , 2.29762085226 , 4.06586361021 , 1.99885747247 , 3.50018608759 , 2.89382577221 , 2.87643825366 , 3.82574308484 , 2.88754786537 , 3.4611622107 , 2.38718055664 , 3.64932069411 , 3.87850569272 , 4.4113182732 , 2.60367705107 , 4.38603456884 , 3.76237502142 , 4.70449294799 , 4.48489780315 , 4.00217675235 , 3.69113872225 , 2.84381752466 , 2.64490642981 , 3.26550030106 , 3.11284322531 , 3.5278606601 , 2.73389921687 , 3.22909639958 , 9.68749273327 , 3.33794329991 , 1.82267761822 , 3.84960343354 , 3.34947114286 , 1.97525234047 , 4.80490149444 , 8.14703674908 , 2.85123026634 , 4.55860899603 , 3.8336676661 , 6.30110432527 , 5.03219707113 , 16.0849484556 , 2.45380197659 , 1.51388666902 , 1.93585020619 , 1.3686990979 , 1.79589742566 , 1.87033918163 , 2.1347025076 , 2.2107307156 , 2.00306285687 , 1.42081441613 , 2.25800807735 , 2.64485987569 , 1.57499868863 , 1.46970759794 , 2.14947144609 , 1.71494163207 , 1.42890994211 , 1.42921051412 , 2.56822992844 , 2.57491186436 , 2.24887120575 , 2.45006028512 , 2.29030145929 , 2.20357005345 , 2.37107043373 , 1.79574736231 , 2.16022404774 , 1.98744860352 , 2.76517152188 , 4.46927922498 , 2.28449240154 , 3.50934876462 , 3.43002757824 , 3.57237690717 , 3.74711858238 , 5.269319282 , 1.91724186837 , 2.37274846701 , 2.74429162252 , 4.33152677022 , 5.19693037903 , 4.14178144568 , 1.3717559139 , 5.10188377373 , 15.3319173641 , 2.72503824835 , 4.43168328127 , 2.77228298597 , 4.00000047582 , 2.78321470794 , 4.4266595246 , 12.3738675504 , 2.2362768749 , 3.53624063741 , 2.17194051215 , 1.80232955064 , 3.11447942993 , 5.58415288653 , 14.1053921526 , 8.57341416642 , 3.15187293847 , 2.76141329912 , 4.07248264248 , 1.99320484803 , 2.91473616599 , 2.20586857277 , 2.94563619851 , 5.42395269199 , 29.078302079 , 14.0218517407 , 20.5513224061 , 8.07341836515 , 6.53713071169 , 3.6100915748 , 2.98813230058 , 2.04783764553 , 2.60001717019 , 1.67795651189 , 2.92481559366 , 1.78590828584 , 0.883847519117 , 2.09792479628 , 2.77275673653 , 6.82743125648 , 2.05469069428 , 4.18963363872 , 5.88560779047 , 3.49943148138 , 2.40634975286 , 3.75794501409 , 3.99229239053 , 1.58456767841 , 3.45776889589 ] +## ftt1 = [ 3.31262327416 , 1.84214332676 , 1.11111111111 , 2.03014464168 , 1.93767258383 , 1.65447074293 , 9.03852728468 , 1.27301117686 , 1.26666666667 , 9.82712031558 , 10.434122288 , 10.373339908 , 9.46630506246 , 4.1728139382 , 5.41262327416 , 4.27879684418 , 6.29760026298 , 9.66288625904 , 11.6660420776 , 11.8333333333 , 10.6944444444 , 10.0307034845 , 3.57557527942 , 11.5675871137 , 10.4951347798 , 12.6495069034 , 8.61134122288 , 7.35282708744 , 15.2697238659 , 11.763477975 , 11.9313938199 , 5.16702827087 , 9.16988823143 , 13.1682117028 , 6.59408284024 , 11.0944444444 , 10.6555555556 , 9.95519395135 , 9.09247205786 , 6.50575279421 , 8.11604207758 , 7.55410913872 , 11.0204470743 , 9.8771860618 , 11.4343523997 , 12.8762656147 , 7.9865877712 , 9.08829717291 , 8.25016436555 , 5.91666666667 , 3.31130834977 , 9.45788954635 , 9.45358316897 , 11.9777120316 , 10.9437869822 , 12.5656147272 , 10.2722222222 , 12.8760026298 , 8.95239973702 , 10.3648915187 , 5.87370151216 , 4.64280078895 , 11.4609138725 , 12.0109467456 , 3.86985535832 , 2.52258382643 , 12.7899408284 , 12.5566732413 , 10.8793228139 , 8.65 , 3.78099934254 , 10.8026298488 , 7.08011176857 , 13.9724194609 , 8.85548980934 , 10.6792899408 , 1.92024983563 , 8.36048652202 , 10.8907626561 , 12.25539119 , 10.9333333333 , 8.59119000657 , 3.31245890861 , 6.69470742932 , 5.44224194609 , 8.9033530572 , 12.6318211703 , 8.3892504931 , 12.5443786982 , 11.1166666667 , 12.7669296515 , 5.2476660092 , 10.1997698882 , 7.16147271532 , 14.1570348455 , 12.6276134122 , 6.18612754767 , 8.52889546351 , 6.97771203156 , 5.6845496384 , 9.83563445102 , 4.45420775805 , 7.94322813938 , 11.9659763314 , 5.65262984878 , 11.1993754109 , 5.48007889546 , 3.85 , 7.94165023011 , 5.82501643655 , 13.3653188692 , 12.3447074293 , 8.30325443787 , 9.31564760026 , 1.98583168968 , 5.0335634451 , 3.27419460881 , 5.45749506903 , 9.69375410914 , 10.5053583169 , 5.52222222222 , 8.88484549638 , 4.34707429323 , 7.59566074951 , 11.1198224852 , 3.9771860618 , 14.2973701512 , 5.28652202498 , 9.70667324129 , 9.508382643 , 12.7611111111 , 8.00660749507 , 11.3608809993 , 15.2407955293 , 4.07712031558 , 11.8497370151 , 13.1331032216 , 11.6076265615 , 9.47376725838 , 5.78333333333 , 5.68783694938 , 5.93011176857 , 6.64806048652 , 5.23185404339 , 16.66617357 , 9.43609467456 , 2.10019723866 , 2.68957922419 , 4.42330703485 , 9.30023011177 , 10.2113412229 , 7.99375410914 , 8.58267587114 , 10.5413872452 , 5.42728468113 , 6.30785667324 , 8.36650230112 , 7.07001972387 , 8.60621301775 , 4.16111111111 , 5.93625904011 ] +## +# time1 = [ 15.0 , 15.1 , 15.2 , 15.3 , 15.4 , 15.5 , 15.6 , 15.7 , 15.8 , 15.9 , 16.0 , 16.1 , 16.2 , 16.3 , 16.4 , 16.5 , 16.6 , 16.7 , 16.8 , 16.9 , 17.0 , 17.1 , 17.2 , 17.3 , 17.4 , 17.5 , 17.6 , 17.7 , 17.8 , 17.9 , 18.0 , 18.1 , 18.2 , 18.3 , 18.4 , 18.5 , 18.6 , 18.7 , 18.8 , 18.9 , 19.0 , 19.1 , 19.2 , 19.3 , 19.4 , 19.5 , 19.6 , 19.7 , 19.8 , 19.9 , 20.0 , 20.1 , 20.2 , 20.3 , 20.4 , 20.5 , 20.6 , 20.7 , 20.8 , 20.9 , 21.0 , 21.1 , 21.2 , 21.3 , 21.4 , 21.5 , 21.6 , 21.7 , 21.8 , 21.9 , 22.0 , 22.1 , 22.2 , 22.3 , 22.4 , 22.5 , 22.6 , 22.7 , 22.8 , 22.9 , 23.0 , 23.1 , 23.2 , 23.3 , 23.4 , 23.5 , 23.6 , 23.7 , 23.8 , 23.9 , 24.0 ] +# oftt1 = [ 3.34016987043 , 2.11315860427 , 3.18601772454 , 2.27078098197 , 1.9420457237 , 1.78898985201 , 3.73454058499 , 1.68480930255 , 3.0386681039 , 2.85571865734 , 3.67601949705 , 3.79573983327 , 2.14938619725 , 3.30385990796 , 2.52350280827 , 2.78920221392 , 2.33322730245 , 1.98399477751 , 1.60538259827 , 1.6598521442 , 1.32650828772 , 1.77548607706 , 1.99973719458 , 2.6260890102 , 0.836643695985 , 3.07519345155 , 1.07249957761 , 2.00305118752 , 2.5596876696 , 3.60327651365 , 1.7923848476 , 2.93387600578 , 2.10630249637 , 2.62657712208 , 4.46121606175 , 3.67395466752 , 6.08488199517 , 2.82596124205 , 3.91241243228 , 2.41879102395 , 5.58772604829 , 5.46544361042 , 2.28721049498 , 2.77276299549 , 3.76564829102 , 2.98083742388 , 2.27925861381 , 4.62218104164 , 2.28501948578 , 3.05490472895 , 3.46676593792 , 3.92566641941 , 2.17956934145 , 1.37175933222 , 6.96433390259 , 2.01892635736 , 1.26722331867 , 2.8570576534 , 1.13259061279 , 1.95600833705 , 3.03595447335 , 2.68137884379 , 2.422802909 , 1.68415431027 , 6.4498319049 , 3.96220874586 , 4.69988034974 , 4.07102932834 , 10.7651747519 , 1.81898918617 , 4.65267675925 , 6.19047595255 , 9.03167793854 , 6.76516119096 , 9.09661653142 , 5.77479201038 , 5.02901085492 , 7.21128650775 , 9.02549607313 , 4.47327569073 , 6.31552038723 , 3.84705878877 , 4.93029548398 , 7.19598955666 , 2.89317645075 , 2.24624292048 , 19.8300025219 , 16.3631961495 , 5.65725732509 , 7.03276276214 , 7.74351929772 ] +# ofpt1 = [ 3.33126992611 , 2.15235043881 , 4.21215375236 , 2.04146402499 , 2.26508236112 , 1.75842743987 , 3.83752010319 , 1.79356812562 , 2.71647871756 , 2.98920028076 , 3.06963761795 , 3.78037524154 , 2.11330949347 , 3.62306600989 , 2.10132375418 , 2.79890211351 , 2.45220911956 , 2.0962944359 , 1.71888897623 , 2.00237892092 , 2.00237892092 , 1.75017286044 , 1.87819485903 , 2.77200592938 , 0.927552735382 , 2.16110258543 , 0.952612535679 , 1.55876494568 , 2.43936505277 , 2.74032154014 , 2.20187230613 , 2.62732676781, 1.81709347884 , 2.68646819361 , 4.87840695719 , 3.58804992604 , 1.96027598281 , 2.16400733578 , 4.55698744552 , 2.61612107743 , 4.1007299461 , 2.60197595024 , 2.42772928849 , 3.70504358394 , 2.64089183244 , 2.53083484208 , 2.69596558723 , 3.82189848477 , 2.10858933652 , 2.69381421149 , 4.48942308279 , 3.48776778082 , 1.75831208948 , 1.48030854681 , 3.2901866737 , 2.33799936521 , 1.50491990853 , 1.23953538087 , 1.19008302381 , 2.36576100342, 2.57888534853 , 2.052794471 , 2.64644323686 , 1.35534774334 , 5.6573022579 , 4.76819909982 , 1.85043233584 , 3.46190356262 , 5.28356384041 , 1.84882416982 , 3.01211103176 , 4.59728665448 , 8.01181670627 , 6.44190774176 , 7.57429158629 , 5.66900034971 , 4.30244931982 , 6.23339404063 , 6.88638460847 , 4.63713969717 , 5.75838213042 , 3.38303474858 , 4.29114582128 , 2.74825804228 , 2.33363923855 , 2.26640425042 , 4.06245325649 , 3.02492973852 , 4.13263598916, 4.06968874886 , 3.87911988994] +# ftt1 = [ 11.9777777778 , 5.30444444444 , 6.60555555556 , 5.95777777778 , 12.5111111111 , 9.20444444444 , 7.46666666667 , 5.53777777778 , 8.21333333333 , 6.09333333333 , 7.58333333333 , 5.55333333333 , 8.17 , 12.5644444444 , 5.17 , 12.4677777778 , 6.09444444444 , 4.99666666667 , 6.82777777778 , 5.94777777778 , 11.0944444444 , 10.26 , 5.23666666667 , 7.97 , 1.59666666667 , 7.39333333333 , 2.73333333333 , 4.52222222222 , 13.65 , 9.81888888889 , 5.72222222222 , 4.58444444444 , 4.84666666667 , 6.91111111111 , 9.93 , 4.4 , 13.1433333333 , 5.34333333333 , 9.29 , 8.00111111111 , 11.3344444444 , 8.30888888889 , 13.0066666667 , 9.40888888889 , 3.65 , 9.62 , 15.25 , 9.95666666667 , 6.53333333333 , 4.36111111111 , 6.1 , 5.91666666667 , 4.94666666667 , 3.92 , 13.6955555556 , 9.13777777778 , 1.22333333333 , 2.35555555556 , 4.62 , 7.94333333333 , 9.09333333333 , 6.67333333333 , 7.17555555556 , 8.79777777778 , 5.32111111111 , 8.37 , 9.10444444444 , 4.39333333333 , 7.40111111111 , 3.44 , 3.62333333333 , 5.64111111111 , 6.80555555556 , 8.66333333333 , 9.05111111111 , 10.2 , 5.94333333333 , 6.72888888889 , 6.26888888889 , 4.31666666667 , 9.28888888889 , 9.24 , 6.27111111111 , 12.4866666667 , 3.67666666667 , 7.58777777778 , 3.85 , 4.34666666667 , 6.28 , 6.28 , 6.28 ] +# time = [] +# oftt= [] +# ftt = [] +# ofpt = [] +# for time10 in range(160,241,10): +# time01 = time10 / 10.0 +# for i in range(len(time1)): +# if time1[i] == time01: +# time.append(time1[i]) +# oftt.append(oftt1[i]) +# ftt.append(ftt1[i]) +# ofpt.append(ofpt1[i]) +# break +# print 'MEAN - oftt: ',np.mean(oftt) +# print 'MEAN - ftt:', np.mean(ftt) +# print 'MEAN - ofpt: ', np.mean(ofpt) +# +# fig = plt.figure(1) +# errorDis1 = plt.subplot(1,1,1) +# ax=plt.gca() +# for tick in ax.xaxis.get_major_ticks(): +# tick.label1.set_fontsize(40) +# for tick in ax.yaxis.get_major_ticks(): +# tick.label1.set_fontsize(40) +# xlim(16,24) +# errorDis1.set_xlabel('Time',size=50) +# errorDis1.set_ylabel('MSE',size=50) +# errorDis1.plot(time,oftt,'sk-',label='TPO-T', linewidth=2.5, markersize=30,markerfacecolor='k',markeredgecolor='k') +# errorDis1.plot(time,ofpt,'*r--',label='TPO-P', linewidth = 2.5, markersize=40,markerfacecolor='r',markeredgecolor='r') +# errorDis1.plot(time,ftt,'.b--',label='TP-T', linewidth = 2.5, markersize=60,markerfacecolor='b',markeredgecolor='b') +# errorDis1.legend(bbox_to_anchor=(1, 1), prop={'size':40}) +# plt.show() +elif graph == 7.9:#O versus T - TPO-T TP-T +#TPO-T v.s. TP-T: MSE as a function of time, 16:00-24:00. # time1 = [ 6.0 , 6.1 , 6.2 , 6.3 , 6.4 , 6.5 , 6.6 , 6.7 , 6.8 , 6.9 , 7.0 , 7.1 , 7.2 , 7.3 , 7.4 , 7.5 , 7.6 , 7.7 , 7.8 , 7.9 , 8.0 , 8.1 , 8.2 , 8.3 , 8.4 , 8.5 , 8.6 , 8.7 , 8.8 , 8.9 , 9.0 , 9.1 , 9.2 , 9.3 , 9.4 , 9.5 , 9.6 , 9.7 , 9.8 , 9.9 , 10.0 , 10.1 , 10.2 , 10.3 , 10.4 , 10.5 , 10.6 , 10.7 , 10.8 , 10.9 , 11.0 , 11.1 , 11.2 , 11.3 , 11.4 , 11.5 , 11.6 , 11.7 , 11.8 , 11.9 , 12.0 , 12.1 , 12.2 , 12.3 , 12.4 , 12.5 , 12.6 , 12.7 , 12.8 , 12.9 , 13.0 , 13.1 , 13.2 , 13.3 , 13.4 , 13.5 , 13.6 , 13.7 , 13.8 , 13.9 , 14.0 , 14.1 , 14.2 , 14.3 , 14.4 , 14.5 , 14.6 , 14.7 , 14.8 , 14.9 , 15.0 , 15.1 , 15.2 , 15.3 , 15.4 , 15.5 , 15.6 , 15.7 , 15.8 , 15.9 , 16.0 , 16.1 , 16.2 , 16.3 , 16.4 , 16.5 , 16.6 , 16.7 , 16.8 , 16.9 , 17.0 , 17.1 , 17.2 , 17.3 , 17.4 , 17.5 , 17.6 , 17.7 , 17.8 , 17.9 , 18.0 , 18.1 , 18.2 , 18.3 , 18.4 , 18.5 , 18.6 , 18.7 , 18.8 , 18.9 , 19.0 , 19.1 , 19.2 , 19.3 , 19.4 , 19.5 , 19.6 , 19.7 , 19.8 , 19.9 , 20.0 , 20.1 , 20.2 , 20.3 , 20.4 , 20.5 , 20.6 , 20.7 , 20.8 , 20.9 , 21.0 , 21.1 , 21.2 , 21.3 , 21.4 , 21.5 , 21.6 , 21.7 , 21.8 , 21.9 , 22.0 ] # oftt1 = [ 2.24145459457 , 1.73143800808 , 0.799179426583 , 2.01173649785 , 1.81718487406 , 1.15549025585 , 2.81841446511 , 1.31058908497 , 1.10303421876 , 0.645413892646 , 2.58626674665 , 3.61801909886 , 0.952661481413 , 1.33722863725 , 2.33427913521 , 3.25891430085 , 1.58177500317 , 3.16742183238 , 3.40244886268 , 2.74782217877 , 2.02421508291 , 3.43543221065 , 2.75801727099 , 3.47512377666 , 3.21835103328 , 3.55187074828 , 2.58031331124 , 2.29762085226 , 4.06586361021 , 1.99885747247 , 3.50018608759 , 2.89382577221 , 2.87643825366 , 3.82574308484 , 2.88754786537 , 3.4611622107 , 2.38718055664 , 3.64932069411 , 3.87850569272 , 4.4113182732 , 2.60367705107 , 4.38603456884 , 3.76237502142 , 4.70449294799 , 4.48489780315 , 4.00217675235 , 3.69113872225 , 2.84381752466 , 2.64490642981 , 3.26550030106 , 3.11284322531 , 3.5278606601 , 2.73389921687 , 3.22909639958 , 9.68749273327 , 3.33794329991 , 1.82267761822 , 3.84960343354 , 3.34947114286 , 1.97525234047 , 4.80490149444 , 8.14703674908 , 2.85123026634 , 4.55860899603 , 3.8336676661 , 6.30110432527 , 5.03219707113 , 16.0849484556 , 2.45380197659 , 1.51388666902 , 1.93585020619 , 1.3686990979 , 1.79589742566 , 1.87033918163 , 2.1347025076 , 2.2107307156 , 2.00306285687 , 1.42081441613 , 2.25800807735 , 2.64485987569 , 1.57499868863 , 1.46970759794 , 2.14947144609 , 1.71494163207 , 1.42890994211 , 1.42921051412 , 2.56822992844 , 2.57491186436 , 2.24887120575 , 2.45006028512 , 2.29030145929 , 2.20357005345 , 2.37107043373 , 1.79574736231 , 2.16022404774 , 1.98744860352 , 2.76517152188 , 4.46927922498 , 2.28449240154 , 3.50934876462 , 3.43002757824 , 3.57237690717 , 3.74711858238 , 5.269319282 , 1.91724186837 , 2.37274846701 , 2.74429162252 , 4.33152677022 , 5.19693037903 , 4.14178144568 , 1.3717559139 , 5.10188377373 , 15.3319173641 , 2.72503824835 , 4.43168328127 , 2.77228298597 , 4.00000047582 , 2.78321470794 , 4.4266595246 , 12.3738675504 , 2.2362768749 , 3.53624063741 , 2.17194051215 , 1.80232955064 , 3.11447942993 , 5.58415288653 , 14.1053921526 , 8.57341416642 , 3.15187293847 , 2.76141329912 , 4.07248264248 , 1.99320484803 , 2.91473616599 , 2.20586857277 , 2.94563619851 , 5.42395269199 , 29.078302079 , 14.0218517407 , 20.5513224061 , 8.07341836515 , 6.53713071169 , 3.6100915748 , 2.98813230058 , 2.04783764553 , 2.60001717019 , 1.67795651189 , 2.92481559366 , 1.78590828584 , 0.883847519117 , 2.09792479628 , 2.77275673653 , 6.82743125648 , 2.05469069428 , 4.18963363872 , 5.88560779047 , 3.49943148138 , 2.40634975286 , 3.75794501409 , 3.99229239053 , 1.58456767841 , 3.45776889589 ] # ftt1 = [ 3.31262327416 , 1.84214332676 , 1.11111111111 , 2.03014464168 , 1.93767258383 , 1.65447074293 , 9.03852728468 , 1.27301117686 , 1.26666666667 , 9.82712031558 , 10.434122288 , 10.373339908 , 9.46630506246 , 4.1728139382 , 5.41262327416 , 4.27879684418 , 6.29760026298 , 9.66288625904 , 11.6660420776 , 11.8333333333 , 10.6944444444 , 10.0307034845 , 3.57557527942 , 11.5675871137 , 10.4951347798 , 12.6495069034 , 8.61134122288 , 7.35282708744 , 15.2697238659 , 11.763477975 , 11.9313938199 , 5.16702827087 , 9.16988823143 , 13.1682117028 , 6.59408284024 , 11.0944444444 , 10.6555555556 , 9.95519395135 , 9.09247205786 , 6.50575279421 , 8.11604207758 , 7.55410913872 , 11.0204470743 , 9.8771860618 , 11.4343523997 , 12.8762656147 , 7.9865877712 , 9.08829717291 , 8.25016436555 , 5.91666666667 , 3.31130834977 , 9.45788954635 , 9.45358316897 , 11.9777120316 , 10.9437869822 , 12.5656147272 , 10.2722222222 , 12.8760026298 , 8.95239973702 , 10.3648915187 , 5.87370151216 , 4.64280078895 , 11.4609138725 , 12.0109467456 , 3.86985535832 , 2.52258382643 , 12.7899408284 , 12.5566732413 , 10.8793228139 , 8.65 , 3.78099934254 , 10.8026298488 , 7.08011176857 , 13.9724194609 , 8.85548980934 , 10.6792899408 , 1.92024983563 , 8.36048652202 , 10.8907626561 , 12.25539119 , 10.9333333333 , 8.59119000657 , 3.31245890861 , 6.69470742932 , 5.44224194609 , 8.9033530572 , 12.6318211703 , 8.3892504931 , 12.5443786982 , 11.1166666667 , 12.7669296515 , 5.2476660092 , 10.1997698882 , 7.16147271532 , 14.1570348455 , 12.6276134122 , 6.18612754767 , 8.52889546351 , 6.97771203156 , 5.6845496384 , 9.83563445102 , 4.45420775805 , 7.94322813938 , 11.9659763314 , 5.65262984878 , 11.1993754109 , 5.48007889546 , 3.85 , 7.94165023011 , 5.82501643655 , 13.3653188692 , 12.3447074293 , 8.30325443787 , 9.31564760026 , 1.98583168968 , 5.0335634451 , 3.27419460881 , 5.45749506903 , 9.69375410914 , 10.5053583169 , 5.52222222222 , 8.88484549638 , 4.34707429323 , 7.59566074951 , 11.1198224852 , 3.9771860618 , 14.2973701512 , 5.28652202498 , 9.70667324129 , 9.508382643 , 12.7611111111 , 8.00660749507 , 11.3608809993 , 15.2407955293 , 4.07712031558 , 11.8497370151 , 13.1331032216 , 11.6076265615 , 9.47376725838 , 5.78333333333 , 5.68783694938 , 5.93011176857 , 6.64806048652 , 5.23185404339 , 16.66617357 , 9.43609467456 , 2.10019723866 , 2.68957922419 , 4.42330703485 , 9.30023011177 , 10.2113412229 , 7.99375410914 , 8.58267587114 , 10.5413872452 , 5.42728468113 , 6.30785667324 , 8.36650230112 , 7.07001972387 , 8.60621301775 , 4.16111111111 , 5.93625904011 ] @@ -275,6 +1226,7 @@ def AutoLocatorInit(self): time01 = time10 / 10.0 for i in range(len(time1)): if time1[i] == time01: + print time1[i], oftt1[i], ftt1[i], ftt1[i]-oftt1[i] time.append(time1[i]) oftt.append(oftt1[i]) ftt.append(ftt1[i]) @@ -282,7 +1234,50 @@ def AutoLocatorInit(self): break print 'MEAN - oftt: ',np.mean(oftt) print 'MEAN - ftt:', np.mean(ftt) - print 'MEAN - ofpt: ', np.mean(ofpt) + #print 'MEAN - ofpt: ', np.mean(ofpt) + fig = plt.figure(1) + errorDis1 = plt.subplot(1,1,1) + ax=plt.gca() + for tick in ax.xaxis.get_major_ticks(): + tick.label1.set_fontsize(xfontsize) + for tick in ax.yaxis.get_major_ticks(): + tick.label1.set_fontsize(yfontsize) + #xlim(17,19) + xlim(16,24) + ylim(0,13) + errorDis1.set_xlabel('Time',size=50) + errorDis1.set_ylabel('MSE',size=50) + errorDis1.plot(time,oftt,'pb-',label='TPO-T', linewidth=2.5, markersize=psize,markerfacecolor='none',markeredgecolor='b',markeredgewidth=mewidth) + errorDis1.plot(time,ftt,'^r--',label='TP-T', linewidth = 2.5, markersize=trisize,markerfacecolor='none',markeredgecolor='r',markeredgewidth=mewidth) + errorDis1.legend(bbox_to_anchor=(1, 1.1), prop={'size':legendsize}) + plt.grid(True, linewidth = gridwidth) + plt.show() +elif graph == 7.1:#O versus T - TPO-T TP-T +#TPO-T v.s. TP-T: MSE as a function of time, 17:00-19:00. +# time1 = [ 6.0 , 6.1 , 6.2 , 6.3 , 6.4 , 6.5 , 6.6 , 6.7 , 6.8 , 6.9 , 7.0 , 7.1 , 7.2 , 7.3 , 7.4 , 7.5 , 7.6 , 7.7 , 7.8 , 7.9 , 8.0 , 8.1 , 8.2 , 8.3 , 8.4 , 8.5 , 8.6 , 8.7 , 8.8 , 8.9 , 9.0 , 9.1 , 9.2 , 9.3 , 9.4 , 9.5 , 9.6 , 9.7 , 9.8 , 9.9 , 10.0 , 10.1 , 10.2 , 10.3 , 10.4 , 10.5 , 10.6 , 10.7 , 10.8 , 10.9 , 11.0 , 11.1 , 11.2 , 11.3 , 11.4 , 11.5 , 11.6 , 11.7 , 11.8 , 11.9 , 12.0 , 12.1 , 12.2 , 12.3 , 12.4 , 12.5 , 12.6 , 12.7 , 12.8 , 12.9 , 13.0 , 13.1 , 13.2 , 13.3 , 13.4 , 13.5 , 13.6 , 13.7 , 13.8 , 13.9 , 14.0 , 14.1 , 14.2 , 14.3 , 14.4 , 14.5 , 14.6 , 14.7 , 14.8 , 14.9 , 15.0 , 15.1 , 15.2 , 15.3 , 15.4 , 15.5 , 15.6 , 15.7 , 15.8 , 15.9 , 16.0 , 16.1 , 16.2 , 16.3 , 16.4 , 16.5 , 16.6 , 16.7 , 16.8 , 16.9 , 17.0 , 17.1 , 17.2 , 17.3 , 17.4 , 17.5 , 17.6 , 17.7 , 17.8 , 17.9 , 18.0 , 18.1 , 18.2 , 18.3 , 18.4 , 18.5 , 18.6 , 18.7 , 18.8 , 18.9 , 19.0 , 19.1 , 19.2 , 19.3 , 19.4 , 19.5 , 19.6 , 19.7 , 19.8 , 19.9 , 20.0 , 20.1 , 20.2 , 20.3 , 20.4 , 20.5 , 20.6 , 20.7 , 20.8 , 20.9 , 21.0 , 21.1 , 21.2 , 21.3 , 21.4 , 21.5 , 21.6 , 21.7 , 21.8 , 21.9 , 22.0 ] +# oftt1 = [ 2.24145459457 , 1.73143800808 , 0.799179426583 , 2.01173649785 , 1.81718487406 , 1.15549025585 , 2.81841446511 , 1.31058908497 , 1.10303421876 , 0.645413892646 , 2.58626674665 , 3.61801909886 , 0.952661481413 , 1.33722863725 , 2.33427913521 , 3.25891430085 , 1.58177500317 , 3.16742183238 , 3.40244886268 , 2.74782217877 , 2.02421508291 , 3.43543221065 , 2.75801727099 , 3.47512377666 , 3.21835103328 , 3.55187074828 , 2.58031331124 , 2.29762085226 , 4.06586361021 , 1.99885747247 , 3.50018608759 , 2.89382577221 , 2.87643825366 , 3.82574308484 , 2.88754786537 , 3.4611622107 , 2.38718055664 , 3.64932069411 , 3.87850569272 , 4.4113182732 , 2.60367705107 , 4.38603456884 , 3.76237502142 , 4.70449294799 , 4.48489780315 , 4.00217675235 , 3.69113872225 , 2.84381752466 , 2.64490642981 , 3.26550030106 , 3.11284322531 , 3.5278606601 , 2.73389921687 , 3.22909639958 , 9.68749273327 , 3.33794329991 , 1.82267761822 , 3.84960343354 , 3.34947114286 , 1.97525234047 , 4.80490149444 , 8.14703674908 , 2.85123026634 , 4.55860899603 , 3.8336676661 , 6.30110432527 , 5.03219707113 , 16.0849484556 , 2.45380197659 , 1.51388666902 , 1.93585020619 , 1.3686990979 , 1.79589742566 , 1.87033918163 , 2.1347025076 , 2.2107307156 , 2.00306285687 , 1.42081441613 , 2.25800807735 , 2.64485987569 , 1.57499868863 , 1.46970759794 , 2.14947144609 , 1.71494163207 , 1.42890994211 , 1.42921051412 , 2.56822992844 , 2.57491186436 , 2.24887120575 , 2.45006028512 , 2.29030145929 , 2.20357005345 , 2.37107043373 , 1.79574736231 , 2.16022404774 , 1.98744860352 , 2.76517152188 , 4.46927922498 , 2.28449240154 , 3.50934876462 , 3.43002757824 , 3.57237690717 , 3.74711858238 , 5.269319282 , 1.91724186837 , 2.37274846701 , 2.74429162252 , 4.33152677022 , 5.19693037903 , 4.14178144568 , 1.3717559139 , 5.10188377373 , 15.3319173641 , 2.72503824835 , 4.43168328127 , 2.77228298597 , 4.00000047582 , 2.78321470794 , 4.4266595246 , 12.3738675504 , 2.2362768749 , 3.53624063741 , 2.17194051215 , 1.80232955064 , 3.11447942993 , 5.58415288653 , 14.1053921526 , 8.57341416642 , 3.15187293847 , 2.76141329912 , 4.07248264248 , 1.99320484803 , 2.91473616599 , 2.20586857277 , 2.94563619851 , 5.42395269199 , 29.078302079 , 14.0218517407 , 20.5513224061 , 8.07341836515 , 6.53713071169 , 3.6100915748 , 2.98813230058 , 2.04783764553 , 2.60001717019 , 1.67795651189 , 2.92481559366 , 1.78590828584 , 0.883847519117 , 2.09792479628 , 2.77275673653 , 6.82743125648 , 2.05469069428 , 4.18963363872 , 5.88560779047 , 3.49943148138 , 2.40634975286 , 3.75794501409 , 3.99229239053 , 1.58456767841 , 3.45776889589 ] +# ftt1 = [ 3.31262327416 , 1.84214332676 , 1.11111111111 , 2.03014464168 , 1.93767258383 , 1.65447074293 , 9.03852728468 , 1.27301117686 , 1.26666666667 , 9.82712031558 , 10.434122288 , 10.373339908 , 9.46630506246 , 4.1728139382 , 5.41262327416 , 4.27879684418 , 6.29760026298 , 9.66288625904 , 11.6660420776 , 11.8333333333 , 10.6944444444 , 10.0307034845 , 3.57557527942 , 11.5675871137 , 10.4951347798 , 12.6495069034 , 8.61134122288 , 7.35282708744 , 15.2697238659 , 11.763477975 , 11.9313938199 , 5.16702827087 , 9.16988823143 , 13.1682117028 , 6.59408284024 , 11.0944444444 , 10.6555555556 , 9.95519395135 , 9.09247205786 , 6.50575279421 , 8.11604207758 , 7.55410913872 , 11.0204470743 , 9.8771860618 , 11.4343523997 , 12.8762656147 , 7.9865877712 , 9.08829717291 , 8.25016436555 , 5.91666666667 , 3.31130834977 , 9.45788954635 , 9.45358316897 , 11.9777120316 , 10.9437869822 , 12.5656147272 , 10.2722222222 , 12.8760026298 , 8.95239973702 , 10.3648915187 , 5.87370151216 , 4.64280078895 , 11.4609138725 , 12.0109467456 , 3.86985535832 , 2.52258382643 , 12.7899408284 , 12.5566732413 , 10.8793228139 , 8.65 , 3.78099934254 , 10.8026298488 , 7.08011176857 , 13.9724194609 , 8.85548980934 , 10.6792899408 , 1.92024983563 , 8.36048652202 , 10.8907626561 , 12.25539119 , 10.9333333333 , 8.59119000657 , 3.31245890861 , 6.69470742932 , 5.44224194609 , 8.9033530572 , 12.6318211703 , 8.3892504931 , 12.5443786982 , 11.1166666667 , 12.7669296515 , 5.2476660092 , 10.1997698882 , 7.16147271532 , 14.1570348455 , 12.6276134122 , 6.18612754767 , 8.52889546351 , 6.97771203156 , 5.6845496384 , 9.83563445102 , 4.45420775805 , 7.94322813938 , 11.9659763314 , 5.65262984878 , 11.1993754109 , 5.48007889546 , 3.85 , 7.94165023011 , 5.82501643655 , 13.3653188692 , 12.3447074293 , 8.30325443787 , 9.31564760026 , 1.98583168968 , 5.0335634451 , 3.27419460881 , 5.45749506903 , 9.69375410914 , 10.5053583169 , 5.52222222222 , 8.88484549638 , 4.34707429323 , 7.59566074951 , 11.1198224852 , 3.9771860618 , 14.2973701512 , 5.28652202498 , 9.70667324129 , 9.508382643 , 12.7611111111 , 8.00660749507 , 11.3608809993 , 15.2407955293 , 4.07712031558 , 11.8497370151 , 13.1331032216 , 11.6076265615 , 9.47376725838 , 5.78333333333 , 5.68783694938 , 5.93011176857 , 6.64806048652 , 5.23185404339 , 16.66617357 , 9.43609467456 , 2.10019723866 , 2.68957922419 , 4.42330703485 , 9.30023011177 , 10.2113412229 , 7.99375410914 , 8.58267587114 , 10.5413872452 , 5.42728468113 , 6.30785667324 , 8.36650230112 , 7.07001972387 , 8.60621301775 , 4.16111111111 , 5.93625904011 ] +# + time1 = [ 15.0 , 15.1 , 15.2 , 15.3 , 15.4 , 15.5 , 15.6 , 15.7 , 15.8 , 15.9 , 16.0 , 16.1 , 16.2 , 16.3 , 16.4 , 16.5 , 16.6 , 16.7 , 16.8 , 16.9 , 17.0 , 17.1 , 17.2 , 17.3 , 17.4 , 17.5 , 17.6 , 17.7 , 17.8 , 17.9 , 18.0 , 18.1 , 18.2 , 18.3 , 18.4 , 18.5 , 18.6 , 18.7 , 18.8 , 18.9 , 19.0 , 19.1 , 19.2 , 19.3 , 19.4 , 19.5 , 19.6 , 19.7 , 19.8 , 19.9 , 20.0 , 20.1 , 20.2 , 20.3 , 20.4 , 20.5 , 20.6 , 20.7 , 20.8 , 20.9 , 21.0 , 21.1 , 21.2 , 21.3 , 21.4 , 21.5 , 21.6 , 21.7 , 21.8 , 21.9 , 22.0 , 22.1 , 22.2 , 22.3 , 22.4 , 22.5 , 22.6 , 22.7 , 22.8 , 22.9 , 23.0 , 23.1 , 23.2 , 23.3 , 23.4 , 23.5 , 23.6 , 23.7 , 23.8 , 23.9 , 24.0 ] + oftt1 = [ 3.34016987043 , 2.11315860427 , 3.18601772454 , 2.27078098197 , 1.9420457237 , 1.78898985201 , 3.73454058499 , 1.68480930255 , 3.0386681039 , 2.85571865734 , 3.67601949705 , 3.79573983327 , 2.14938619725 , 3.30385990796 , 2.52350280827 , 2.78920221392 , 2.33322730245 , 1.98399477751 , 1.60538259827 , 1.6598521442 , 1.32650828772 , 1.77548607706 , 1.99973719458 , 2.6260890102 , 0.836643695985 , 3.07519345155 , 1.07249957761 , 2.00305118752 , 2.5596876696 , 3.60327651365 , 1.7923848476 , 2.93387600578 , 2.10630249637 , 2.62657712208 , 4.46121606175 , 3.67395466752 , 6.08488199517 , 2.82596124205 , 3.91241243228 , 2.41879102395 , 5.58772604829 , 5.46544361042 , 2.28721049498 , 2.77276299549 , 3.76564829102 , 2.98083742388 , 2.27925861381 , 4.62218104164 , 2.28501948578 , 3.05490472895 , 3.46676593792 , 3.92566641941 , 2.17956934145 , 1.37175933222 , 6.96433390259 , 2.01892635736 , 1.26722331867 , 2.8570576534 , 1.13259061279 , 1.95600833705 , 3.03595447335 , 2.68137884379 , 2.422802909 , 1.68415431027 , 6.4498319049 , 3.96220874586 , 4.69988034974 , 4.07102932834 , 10.7651747519 , 1.81898918617 , 4.65267675925 , 6.19047595255 , 9.03167793854 , 6.76516119096 , 9.09661653142 , 5.77479201038 , 5.02901085492 , 7.21128650775 , 9.02549607313 , 4.47327569073 , 6.31552038723 , 3.84705878877 , 4.93029548398 , 7.19598955666 , 2.89317645075 , 2.24624292048 , 19.8300025219 , 16.3631961495 , 5.65725732509 , 7.03276276214 , 7.74351929772 ] + ofpt1 = [ 3.33126992611 , 2.15235043881 , 4.21215375236 , 2.04146402499 , 2.26508236112 , 1.75842743987 , 3.83752010319 , 1.79356812562 , 2.71647871756 , 2.98920028076 , 3.06963761795 , 3.78037524154 , 2.11330949347 , 3.62306600989 , 2.10132375418 , 2.79890211351 , 2.45220911956 , 2.0962944359 , 1.71888897623 , 2.00237892092 , 2.00237892092 , 1.75017286044 , 1.87819485903 , 2.77200592938 , 0.927552735382 , 2.16110258543 , 0.952612535679 , 1.55876494568 , 2.43936505277 , 2.74032154014 , 2.20187230613 , 2.62732676781, 1.81709347884 , 2.68646819361 , 4.87840695719 , 3.58804992604 , 1.96027598281 , 2.16400733578 , 4.55698744552 , 2.61612107743 , 4.1007299461 , 2.60197595024 , 2.42772928849 , 3.70504358394 , 2.64089183244 , 2.53083484208 , 2.69596558723 , 3.82189848477 , 2.10858933652 , 2.69381421149 , 4.48942308279 , 3.48776778082 , 1.75831208948 , 1.48030854681 , 3.2901866737 , 2.33799936521 , 1.50491990853 , 1.23953538087 , 1.19008302381 , 2.36576100342, 2.57888534853 , 2.052794471 , 2.64644323686 , 1.35534774334 , 5.6573022579 , 4.76819909982 , 1.85043233584 , 3.46190356262 , 5.28356384041 , 1.84882416982 , 3.01211103176 , 4.59728665448 , 8.01181670627 , 6.44190774176 , 7.57429158629 , 5.66900034971 , 4.30244931982 , 6.23339404063 , 6.88638460847 , 4.63713969717 , 5.75838213042 , 3.38303474858 , 4.29114582128 , 2.74825804228 , 2.33363923855 , 2.26640425042 , 4.06245325649 , 3.02492973852 , 4.13263598916, 4.06968874886 , 3.87911988994] + ftt1 = [ 11.9777777778 , 5.30444444444 , 6.60555555556 , 5.95777777778 , 12.5111111111 , 9.20444444444 , 7.46666666667 , 5.53777777778 , 8.21333333333 , 6.09333333333 , 7.58333333333 , 5.55333333333 , 8.17 , 12.5644444444 , 5.17 , 12.4677777778 , 6.09444444444 , 4.99666666667 , 6.82777777778 , 5.94777777778 , 11.0944444444 , 10.26 , 5.23666666667 , 7.97 , 1.59666666667 , 7.39333333333 , 2.73333333333 , 4.52222222222 , 13.65 , 9.81888888889 , 5.72222222222 , 4.58444444444 , 4.84666666667 , 6.91111111111 , 9.93 , 4.4 , 13.1433333333 , 5.34333333333 , 9.29 , 8.00111111111 , 11.3344444444 , 8.30888888889 , 13.0066666667 , 9.40888888889 , 3.65 , 9.62 , 15.25 , 9.95666666667 , 6.53333333333 , 4.36111111111 , 6.1 , 5.91666666667 , 4.94666666667 , 3.92 , 13.6955555556 , 9.13777777778 , 1.22333333333 , 2.35555555556 , 4.62 , 7.94333333333 , 9.09333333333 , 6.67333333333 , 7.17555555556 , 8.79777777778 , 5.32111111111 , 8.37 , 9.10444444444 , 4.39333333333 , 7.40111111111 , 3.44 , 3.62333333333 , 5.64111111111 , 6.80555555556 , 8.66333333333 , 9.05111111111 , 10.2 , 5.94333333333 , 6.72888888889 , 6.26888888889 , 4.31666666667 , 9.28888888889 , 9.24 , 6.27111111111 , 12.4866666667 , 3.67666666667 , 7.58777777778 , 3.85 , 4.34666666667 , 6.28 , 6.28 , 6.28 ] + time = [] + oftt= [] + ftt = [] + ofpt = [] + for time10 in range(160,241,1): + time01 = time10 / 10.0 + for i in range(len(time1)): + if time1[i] == time01: + time.append(time1[i]) + oftt.append(oftt1[i]) + ftt.append(ftt1[i]) + ofpt.append(ofpt1[i]) + break + print 'MEAN - oftt: ',np.mean(oftt) + print 'MEAN - ftt:', np.mean(ftt) + #print 'MEAN - ofpt: ', np.mean(ofpt) fig = plt.figure(1) errorDis1 = plt.subplot(1,1,1) @@ -291,14 +1286,20 @@ def AutoLocatorInit(self): tick.label1.set_fontsize(40) for tick in ax.yaxis.get_major_ticks(): tick.label1.set_fontsize(40) - xlim(16,24) + xlim(17,19) + #xlim(16,24) + ylim(0,15) errorDis1.set_xlabel('Time',size=50) errorDis1.set_ylabel('MSE',size=50) - errorDis1.plot(time,oftt,'sk-',label='TFO-T', linewidth=2.5, markersize=30,markerfacecolor='k',markeredgecolor='k') - errorDis1.plot(time,ofpt,'*r--',label='TFO-P', linewidth = 2.5, markersize=40,markerfacecolor='r',markeredgecolor='r') - errorDis1.plot(time,ftt,'.b--',label='TF-T', linewidth = 2.5, markersize=60,markerfacecolor='b',markeredgecolor='b') - errorDis1.legend(bbox_to_anchor=(1, 1), prop={'size':40}) + errorDis1.plot(time,oftt,'sk-',label='TPO-T', linewidth=2.5, markersize=30,markerfacecolor='k',markeredgecolor='k') + #errorDis1.plot(time,ofpt,'*r--',label='TPO-P', linewidth = 2.5, markersize=40,markerfacecolor='r',markeredgecolor='r') + errorDis1.plot(time,ftt,'.b--',label='TP-T', linewidth = 2.5, markersize=60,markerfacecolor='b',markeredgecolor='b') + #errorDis1.legend(bbox_to_anchor=(1, 1), prop={'size':40}) + errorDis1.legend(bbox_to_anchor=(0, 0.8), loc=0, borderaxespad=0.,prop={'size':40}) + plt.grid(True, linewidth = 3) plt.show() + + #elif graph == 7.1:#O versus T - OFTT VS FTT # oftt = [10.09620521181539, 5.8067972281235818, 5.035087650145921, 4.7163601794937513, 8.518796844352293, 5.0799617866835289, 7.7447764865573907, 16.861248903953573, 20.239803181656697] # ftt = [12.490000000000009, 12.734444444444431, 11.111111111111127, 15.73444444444446, 16.0, 14.097777777777765, 13.690000000000021, 13.95111111111116, 14.210000000000001] @@ -317,10 +1318,64 @@ def AutoLocatorInit(self): # xlim(16,24) # errorDis1.set_xlabel('time',size=50) # errorDis1.set_ylabel('Refined MSE',size=50) -# errorDis1.plot(time,oftt,'sk-',label='TFO-TT', linewidth=2.5, markersize=20,markerfacecolor='k',markeredgecolor='k') -# errorDis1.plot(time,ftt,'*r--',label='TF-T', linewidth = 2.5, markersize=25,markerfacecolor='r',markeredgecolor='r') +# errorDis1.plot(time,oftt,'sk-',label='TPO-TT', linewidth=2.5, markersize=20,markerfacecolor='k',markeredgecolor='k') +# errorDis1.plot(time,ftt,'*r--',label='TP-T', linewidth = 2.5, markersize=25,markerfacecolor='r',markeredgecolor='r') # errorDis1.legend(bbox_to_anchor=(1, 1), prop={'size':40}) # plt.show() + + + +elif graph == 7.6:#O versus T - TPO-T TP-T - train 1 month predict 3 month +#TPO-T v.s. TP-T: MSE as a function of time, 16:00-20:00. +# time1 = [ 6.0 , 6.1 , 6.2 , 6.3 , 6.4 , 6.5 , 6.6 , 6.7 , 6.8 , 6.9 , 7.0 , 7.1 , 7.2 , 7.3 , 7.4 , 7.5 , 7.6 , 7.7 , 7.8 , 7.9 , 8.0 , 8.1 , 8.2 , 8.3 , 8.4 , 8.5 , 8.6 , 8.7 , 8.8 , 8.9 , 9.0 , 9.1 , 9.2 , 9.3 , 9.4 , 9.5 , 9.6 , 9.7 , 9.8 , 9.9 , 10.0 , 10.1 , 10.2 , 10.3 , 10.4 , 10.5 , 10.6 , 10.7 , 10.8 , 10.9 , 11.0 , 11.1 , 11.2 , 11.3 , 11.4 , 11.5 , 11.6 , 11.7 , 11.8 , 11.9 , 12.0 , 12.1 , 12.2 , 12.3 , 12.4 , 12.5 , 12.6 , 12.7 , 12.8 , 12.9 , 13.0 , 13.1 , 13.2 , 13.3 , 13.4 , 13.5 , 13.6 , 13.7 , 13.8 , 13.9 , 14.0 , 14.1 , 14.2 , 14.3 , 14.4 , 14.5 , 14.6 , 14.7 , 14.8 , 14.9 , 15.0 , 15.1 , 15.2 , 15.3 , 15.4 , 15.5 , 15.6 , 15.7 , 15.8 , 15.9 , 16.0 , 16.1 , 16.2 , 16.3 , 16.4 , 16.5 , 16.6 , 16.7 , 16.8 , 16.9 , 17.0 , 17.1 , 17.2 , 17.3 , 17.4 , 17.5 , 17.6 , 17.7 , 17.8 , 17.9 , 18.0 , 18.1 , 18.2 , 18.3 , 18.4 , 18.5 , 18.6 , 18.7 , 18.8 , 18.9 , 19.0 , 19.1 , 19.2 , 19.3 , 19.4 , 19.5 , 19.6 , 19.7 , 19.8 , 19.9 , 20.0 , 20.1 , 20.2 , 20.3 , 20.4 , 20.5 , 20.6 , 20.7 , 20.8 , 20.9 , 21.0 , 21.1 , 21.2 , 21.3 , 21.4 , 21.5 , 21.6 , 21.7 , 21.8 , 21.9 , 22.0 ] +# oftt1 = [ 2.24145459457 , 1.73143800808 , 0.799179426583 , 2.01173649785 , 1.81718487406 , 1.15549025585 , 2.81841446511 , 1.31058908497 , 1.10303421876 , 0.645413892646 , 2.58626674665 , 3.61801909886 , 0.952661481413 , 1.33722863725 , 2.33427913521 , 3.25891430085 , 1.58177500317 , 3.16742183238 , 3.40244886268 , 2.74782217877 , 2.02421508291 , 3.43543221065 , 2.75801727099 , 3.47512377666 , 3.21835103328 , 3.55187074828 , 2.58031331124 , 2.29762085226 , 4.06586361021 , 1.99885747247 , 3.50018608759 , 2.89382577221 , 2.87643825366 , 3.82574308484 , 2.88754786537 , 3.4611622107 , 2.38718055664 , 3.64932069411 , 3.87850569272 , 4.4113182732 , 2.60367705107 , 4.38603456884 , 3.76237502142 , 4.70449294799 , 4.48489780315 , 4.00217675235 , 3.69113872225 , 2.84381752466 , 2.64490642981 , 3.26550030106 , 3.11284322531 , 3.5278606601 , 2.73389921687 , 3.22909639958 , 9.68749273327 , 3.33794329991 , 1.82267761822 , 3.84960343354 , 3.34947114286 , 1.97525234047 , 4.80490149444 , 8.14703674908 , 2.85123026634 , 4.55860899603 , 3.8336676661 , 6.30110432527 , 5.03219707113 , 16.0849484556 , 2.45380197659 , 1.51388666902 , 1.93585020619 , 1.3686990979 , 1.79589742566 , 1.87033918163 , 2.1347025076 , 2.2107307156 , 2.00306285687 , 1.42081441613 , 2.25800807735 , 2.64485987569 , 1.57499868863 , 1.46970759794 , 2.14947144609 , 1.71494163207 , 1.42890994211 , 1.42921051412 , 2.56822992844 , 2.57491186436 , 2.24887120575 , 2.45006028512 , 2.29030145929 , 2.20357005345 , 2.37107043373 , 1.79574736231 , 2.16022404774 , 1.98744860352 , 2.76517152188 , 4.46927922498 , 2.28449240154 , 3.50934876462 , 3.43002757824 , 3.57237690717 , 3.74711858238 , 5.269319282 , 1.91724186837 , 2.37274846701 , 2.74429162252 , 4.33152677022 , 5.19693037903 , 4.14178144568 , 1.3717559139 , 5.10188377373 , 15.3319173641 , 2.72503824835 , 4.43168328127 , 2.77228298597 , 4.00000047582 , 2.78321470794 , 4.4266595246 , 12.3738675504 , 2.2362768749 , 3.53624063741 , 2.17194051215 , 1.80232955064 , 3.11447942993 , 5.58415288653 , 14.1053921526 , 8.57341416642 , 3.15187293847 , 2.76141329912 , 4.07248264248 , 1.99320484803 , 2.91473616599 , 2.20586857277 , 2.94563619851 , 5.42395269199 , 29.078302079 , 14.0218517407 , 20.5513224061 , 8.07341836515 , 6.53713071169 , 3.6100915748 , 2.98813230058 , 2.04783764553 , 2.60001717019 , 1.67795651189 , 2.92481559366 , 1.78590828584 , 0.883847519117 , 2.09792479628 , 2.77275673653 , 6.82743125648 , 2.05469069428 , 4.18963363872 , 5.88560779047 , 3.49943148138 , 2.40634975286 , 3.75794501409 , 3.99229239053 , 1.58456767841 , 3.45776889589 ] +# ftt1 = [ 3.31262327416 , 1.84214332676 , 1.11111111111 , 2.03014464168 , 1.93767258383 , 1.65447074293 , 9.03852728468 , 1.27301117686 , 1.26666666667 , 9.82712031558 , 10.434122288 , 10.373339908 , 9.46630506246 , 4.1728139382 , 5.41262327416 , 4.27879684418 , 6.29760026298 , 9.66288625904 , 11.6660420776 , 11.8333333333 , 10.6944444444 , 10.0307034845 , 3.57557527942 , 11.5675871137 , 10.4951347798 , 12.6495069034 , 8.61134122288 , 7.35282708744 , 15.2697238659 , 11.763477975 , 11.9313938199 , 5.16702827087 , 9.16988823143 , 13.1682117028 , 6.59408284024 , 11.0944444444 , 10.6555555556 , 9.95519395135 , 9.09247205786 , 6.50575279421 , 8.11604207758 , 7.55410913872 , 11.0204470743 , 9.8771860618 , 11.4343523997 , 12.8762656147 , 7.9865877712 , 9.08829717291 , 8.25016436555 , 5.91666666667 , 3.31130834977 , 9.45788954635 , 9.45358316897 , 11.9777120316 , 10.9437869822 , 12.5656147272 , 10.2722222222 , 12.8760026298 , 8.95239973702 , 10.3648915187 , 5.87370151216 , 4.64280078895 , 11.4609138725 , 12.0109467456 , 3.86985535832 , 2.52258382643 , 12.7899408284 , 12.5566732413 , 10.8793228139 , 8.65 , 3.78099934254 , 10.8026298488 , 7.08011176857 , 13.9724194609 , 8.85548980934 , 10.6792899408 , 1.92024983563 , 8.36048652202 , 10.8907626561 , 12.25539119 , 10.9333333333 , 8.59119000657 , 3.31245890861 , 6.69470742932 , 5.44224194609 , 8.9033530572 , 12.6318211703 , 8.3892504931 , 12.5443786982 , 11.1166666667 , 12.7669296515 , 5.2476660092 , 10.1997698882 , 7.16147271532 , 14.1570348455 , 12.6276134122 , 6.18612754767 , 8.52889546351 , 6.97771203156 , 5.6845496384 , 9.83563445102 , 4.45420775805 , 7.94322813938 , 11.9659763314 , 5.65262984878 , 11.1993754109 , 5.48007889546 , 3.85 , 7.94165023011 , 5.82501643655 , 13.3653188692 , 12.3447074293 , 8.30325443787 , 9.31564760026 , 1.98583168968 , 5.0335634451 , 3.27419460881 , 5.45749506903 , 9.69375410914 , 10.5053583169 , 5.52222222222 , 8.88484549638 , 4.34707429323 , 7.59566074951 , 11.1198224852 , 3.9771860618 , 14.2973701512 , 5.28652202498 , 9.70667324129 , 9.508382643 , 12.7611111111 , 8.00660749507 , 11.3608809993 , 15.2407955293 , 4.07712031558 , 11.8497370151 , 13.1331032216 , 11.6076265615 , 9.47376725838 , 5.78333333333 , 5.68783694938 , 5.93011176857 , 6.64806048652 , 5.23185404339 , 16.66617357 , 9.43609467456 , 2.10019723866 , 2.68957922419 , 4.42330703485 , 9.30023011177 , 10.2113412229 , 7.99375410914 , 8.58267587114 , 10.5413872452 , 5.42728468113 , 6.30785667324 , 8.36650230112 , 7.07001972387 , 8.60621301775 , 4.16111111111 , 5.93625904011 ] +# + time1 = [ 16.0 , 16.1 , 16.2 , 16.3 , 16.4 , 16.5 , 16.6 , 16.7 , 16.8 , 16.9 , 17.0 , 17.1 , 17.2 , 17.3 , 17.4 , 17.5 , 17.6 , 17.7 , 17.8 , 17.9 , 18.0 , 18.1 , 18.2 , 18.3 , 18.4 , 18.5 , 18.6 , 18.7 , 18.8 , 18.9 , 19.0 , 19.1 , 19.2 , 19.3 , 19.4 , 19.5 , 19.6 , 19.7 , 19.8 , 19.9 , 20.0 , 20.1 , 20.2 , 20.3 , 20.4 , 20.5 , 20.6 , 20.7 , 20.8 , 20.9 , 21.0 , 21.1 , 21.2 , 21.3 , 21.4 , 21.5 , 21.6 , 21.7 , 21.8 , 21.9 , 22.0 , 22.1 , 22.2 , 22.3 , 22.4 , 22.5 , 22.6 , 22.7 , 22.8 , 22.9 , 23.0 , 23.1 , 23.2 , 23.3 , 23.4 , 23.5 , 23.6 , 23.7 , 23.8 , 23.9 , 24.0 ] + oftt1 = [3.43002757824 , 3.57237690717 , 3.74711858238 , 5.269319282 , 1.91724186837 , 2.37274846701 , 2.74429162252 , 4.33152677022 , 5.19693037903 , 4.14178144568 , 1.3717559139 , 5.10188377373 , 15.3319173641 , 2.72503824835 , 4.43168328127 , 2.77228298597 , 4.00000047582 , 2.78321470794 , 4.4266595246 , 12.3738675504 , 2.2362768749, +3.53624063741 , 2.17194051215 , 1.80232955064 , 3.11447942993 , 5.58415288653 , 14.1053921526 , 8.57341416642 , 3.15187293847 , 2.76141329912 , 4.07248264248 , 1.99320484803 , 2.91473616599 , 2.20586857277 , 2.94563619851 , 5.42395269199 , 29.078302079 , 14.0218517407 , 20.5513224061 , 8.07341836515 , 6.53713071169, +3.6100915748 , 2.98813230058 , 2.04783764553 , 2.60001717019 , 1.67795651189 , 2.92481559366 , 1.78590828584 , 0.883847519117 , 2.09792479628 , 2.77275673653 , 6.82743125648 , 2.05469069428 , 4.18963363872 , 5.88560779047 , 3.49943148138 , 2.40634975286 , 3.75794501409 , 3.99229239053 , 1.58456767841 , 3.45776889589, +3.41214758457 , 4.49398564669 , 5.74646562364 , 5.48328679119 , 4.47313718235 , 3.42934089259 , 3.73898217797 , 4.26509845882 , 3.09824723353 , 3.33960558247 , 2.80411588104 , 3.82528798575 , 2.5340502579 , 1.54516681366 , 2.14719559893 , 3.13207277185 , 6.40993917828 , 6.15909118801 , 2.40707452613 , 2.20642583678] + ofpt1 = [ 3.33126992611 , 2.15235043881 , 4.21215375236 , 2.04146402499 , 2.26508236112 , 1.75842743987 , 3.83752010319 , 1.79356812562 , 2.71647871756 , 2.98920028076 , 3.06963761795 , 3.78037524154 , 2.11330949347 , 3.62306600989 , 2.10132375418 , 2.79890211351 , 2.45220911956 , 2.0962944359 , 1.71888897623 , 2.00237892092 , 2.00237892092 , 1.75017286044 , 1.87819485903 , 2.77200592938 , 0.927552735382 , 2.16110258543 , 0.952612535679 , 1.55876494568 , 2.43936505277 , 2.74032154014 , 2.20187230613 , 2.62732676781, 1.81709347884 , 2.68646819361 , 4.87840695719 , 3.58804992604 , 1.96027598281 , 2.16400733578 , 4.55698744552 , 2.61612107743 , 4.1007299461 , 2.60197595024 , 2.42772928849 , 3.70504358394 , 2.64089183244 , 2.53083484208 , 2.69596558723 , 3.82189848477 , 2.10858933652 , 2.69381421149 , 4.48942308279 , 3.48776778082 , 1.75831208948 , 1.48030854681 , 3.2901866737 , 2.33799936521 , 1.50491990853 , 1.23953538087 , 1.19008302381 , 2.36576100342, 2.57888534853 , 2.052794471 , 2.64644323686 , 1.35534774334 , 5.6573022579 , 4.76819909982 , 1.85043233584 , 3.46190356262 , 5.28356384041 , 1.84882416982 , 3.01211103176 , 4.59728665448 , 8.01181670627 , 6.44190774176 , 7.57429158629 , 5.66900034971 , 4.30244931982 , 6.23339404063 , 6.88638460847 , 4.63713969717 , 5.75838213042 , 3.38303474858 , 4.29114582128 , 2.74825804228 , 2.33363923855 , 2.26640425042 , 4.06245325649 , 3.02492973852 , 4.13263598916, 4.06968874886 , 3.87911988994] + ftt1 = [ 9.83563445102 , 4.45420775805 , 7.94322813938 , 11.9659763314 , 5.65262984878 , 11.1993754109 , 5.48007889546 , 3.85 , 7.94165023011 , 5.82501643655 , 13.3653188692 , 12.3447074293 , 8.30325443787 , 9.31564760026 , 1.98583168968 , 5.0335634451 , 3.27419460881 , 5.45749506903 , 9.69375410914 , 10.5053583169 , 5.52222222222 , 8.88484549638 , 4.34707429323 , 7.59566074951 , 11.1198224852 , 3.9771860618 , 14.2973701512 , 5.28652202498 , 9.70667324129 , 9.508382643 , 12.7611111111 , 8.00660749507 , 11.3608809993 , 15.2407955293 , 4.07712031558 , 11.8497370151 , 13.1331032216 , 11.6076265615 , 9.47376725838 , 5.78333333333 , 5.68783694938 , 5.93011176857 , 6.64806048652 , 5.23185404339 , 16.66617357 , 9.43609467456 , 2.10019723866 , 2.68957922419 , 4.42330703485 , 9.30023011177 , 10.2113412229 , 7.99375410914 , 8.58267587114 , 10.5413872452 , 5.42728468113 , 6.30785667324 , 8.36650230112 , 7.07001972387 , 8.60621301775 , 4.16111111111 , 5.93625904011 , 6.18609467456 , 6.48339907955 , 8.11666666667 , 6.93103221565 , 7.29769888231 , 5.49460880999 , 6.24552925707 , 5.84444444444 , 3.8006574622 , 7.56084812623 , 8.12495069034 , 6.20555555556 , 10.6097633136 , 2.70177514793 , 7.62028270874 , 3.81203155819 , 5.08681788297 , 4.42580539119 , 4.42580539119 , 4.42580539119 ] + time = [] + oftt= [] + ftt = [] + ofpt = [] + for time10 in range(160,241,10): + time01 = time10 / 10.0 + for i in range(len(time1)): + if time1[i] == time01: + print time1[i], oftt1[i], ftt1[i], ftt1[i]-oftt1[i] + time.append(time1[i]) + oftt.append(oftt1[i]) + ftt.append(ftt1[i]) + ofpt.append(ofpt1[i]) + break + print 'MEAN - oftt: ',np.mean(oftt) + print 'MEAN - ftt:', np.mean(ftt) + #print 'MEAN - ofpt: ', np.mean(ofpt) + + fig = plt.figure(1) + errorDis1 = plt.subplot(1,1,1) + ax=plt.gca() + for tick in ax.xaxis.get_major_ticks(): + tick.label1.set_fontsize(40) + for tick in ax.yaxis.get_major_ticks(): + tick.label1.set_fontsize(40) + xlim(16,24) + #xlim(20,22) + ylim(0,20) + errorDis1.set_xlabel('Time',size=50) + errorDis1.set_ylabel('MSE',size=50) + errorDis1.plot(time,oftt,'sk-',label='TPO-T', linewidth=2.5, markersize=30,markerfacecolor='k',markeredgecolor='k') + #errorDis1.plot(time,ofpt,'*r--',label='TPO-P', linewidth = 2.5, markersize=40,markerfacecolor='r',markeredgecolor='r') + errorDis1.plot(time,ftt,'.b--',label='TP-T', linewidth = 2.5, markersize=60,markerfacecolor='b',markeredgecolor='b') + errorDis1.legend(bbox_to_anchor=(1, 1), prop={'size':40}) + #errorDis1.legend(bbox_to_anchor=(0, 0.8), loc=0, borderaxespad=0.,prop={'size':40}) + plt.grid(True, linewidth = 3) + plt.show() + #elif graph == 8:#Fine-grained versus Sparse - OFTT VS OST VS ST # time = [ 6.0 , 6.1 , 6.2 , 6.3 , 6.4 , 6.5 , 6.6 , 6.7 , 6.8 , 6.9 , 7.0 , 7.1 , 7.2 , 7.3 , 7.4 , 7.5 , 7.6 , 7.7 , 7.8 , 7.9 , 8.0 , 8.1 , 8.2 , 8.3 , 8.4 , 8.5 , 8.6 , 8.7 , 8.8 , 8.9 , 9.0 , 9.1 , 9.2 , 9.3 , 9.4 , 9.5 , 9.6 , 9.7 , 9.8 , 9.9 , 10.0 , 10.1 , 10.2 , 10.3 , 10.4 , 10.5 , 10.6 , 10.7 , 10.8 , 10.9 , 11.0 , 11.1 , 11.2 , 11.3 , 11.4 , 11.5 , 11.6 , 11.7 , 11.8 , 11.9 , 12.0 , 12.1 , 12.2 , 12.3 , 12.4 , 12.5 , 12.6 , 12.7 , 12.8 , 12.9 , 13.0 , 13.1 , 13.2 , 13.3 , 13.4 , 13.5 , 13.6 , 13.7 , 13.8 , 13.9 , 14.0 , 14.1 , 14.2 , 14.3 , 14.4 , 14.5 , 14.6 , 14.7 , 14.8 , 14.9 , 15.0 , 15.1 , 15.2 , 15.3 , 15.4 , 15.5 , 15.6 , 15.7 , 15.8 , 15.9 , 16.0 , 16.1 , 16.2 , 16.3 , 16.4 , 16.5 , 16.6 , 16.7 , 16.8 , 16.9 , 17.0 , 17.1 , 17.2 , 17.3 , 17.4 , 17.5 , 17.6 , 17.7 , 17.8 , 17.9 , 18.0 , 18.1 , 18.2 , 18.3 , 18.4 , 18.5 , 18.6 , 18.7 , 18.8 , 18.9 , 19.0 , 19.1 , 19.2 , 19.3 , 19.4 , 19.5 , 19.6 , 19.7 , 19.8 , 19.9 , 20.0 , 20.1 , 20.2 , 20.3 , 20.4 , 20.5 , 20.6 , 20.7 , 20.8 , 20.9 , 21.0 , 21.1 , 21.2 , 21.3 , 21.4 , 21.5 , 21.6 , 21.7 , 21.8 , 21.9 , 22.0 ] # oftt = [ 2.24145459457 , 1.73143800808 , 0.799179426583 , 2.01173649785 , 1.81718487406 , 1.15549025585 , 2.81841446511 , 1.31058908497 , 1.10303421876 , 0.645413892646 , 2.58626674665 , 3.61801909886 , 0.952661481413 , 1.33722863725 , 2.33427913521 , 3.25891430085 , 1.58177500317 , 3.16742183238 , 3.40244886268 , 2.74782217877 , 2.02421508291 , 3.43543221065 , 2.75801727099 , 3.47512377666 , 3.21835103328 , 3.55187074828 , 2.58031331124 , 2.29762085226 , 4.06586361021 , 1.99885747247 , 3.50018608759 , 2.89382577221 , 2.87643825366 , 3.82574308484 , 2.88754786537 , 3.4611622107 , 2.38718055664 , 3.64932069411 , 3.87850569272 , 4.4113182732 , 2.60367705107 , 4.38603456884 , 3.76237502142 , 4.70449294799 , 4.48489780315 , 4.00217675235 , 3.69113872225 , 2.84381752466 , 2.64490642981 , 3.26550030106 , 3.11284322531 , 3.5278606601 , 2.73389921687 , 3.22909639958 , 9.68749273327 , 3.33794329991 , 1.82267761822 , 3.84960343354 , 3.34947114286 , 1.97525234047 , 4.80490149444 , 8.14703674908 , 2.85123026634 , 4.55860899603 , 3.8336676661 , 6.30110432527 , 5.03219707113 , 16.0849484556 , 2.45380197659 , 1.51388666902 , 1.93585020619 , 1.3686990979 , 1.79589742566 , 1.87033918163 , 2.1347025076 , 2.2107307156 , 2.00306285687 , 1.42081441613 , 2.25800807735 , 2.64485987569 , 1.57499868863 , 1.46970759794 , 2.14947144609 , 1.71494163207 , 1.42890994211 , 1.42921051412 , 2.56822992844 , 2.57491186436 , 2.24887120575 , 2.45006028512 , 2.29030145929 , 2.20357005345 , 2.37107043373 , 1.79574736231 , 2.16022404774 , 1.98744860352 , 2.76517152188 , 4.46927922498 , 2.28449240154 , 3.50934876462 , 3.43002757824 , 3.57237690717 , 3.74711858238 , 5.269319282 , 1.91724186837 , 2.37274846701 , 2.74429162252 , 4.33152677022 , 5.19693037903 , 4.14178144568 , 1.3717559139 , 5.10188377373 , 15.3319173641 , 2.72503824835 , 4.43168328127 , 2.77228298597 , 4.00000047582 , 2.78321470794 , 4.4266595246 , 12.3738675504 , 2.2362768749 , 3.53624063741 , 2.17194051215 , 1.80232955064 , 3.11447942993 , 5.58415288653 , 14.1053921526 , 8.57341416642 , 3.15187293847 , 2.76141329912 , 4.07248264248 , 1.99320484803 , 2.91473616599 , 2.20586857277 , 2.94563619851 , 5.42395269199 , 29.078302079 , 14.0218517407 , 20.5513224061 , 8.07341836515 , 6.53713071169 , 3.6100915748 , 2.98813230058 , 2.04783764553 , 2.60001717019 , 1.67795651189 , 2.92481559366 , 1.78590828584 , 0.883847519117 , 2.09792479628 , 2.77275673653 , 6.82743125648 , 2.05469069428 , 4.18963363872 , 5.88560779047 , 3.49943148138 , 2.40634975286 , 3.75794501409 , 3.99229239053 , 1.58456767841 , 3.45776889589 ] @@ -438,8 +1493,8 @@ def AutoLocatorInit(self): # xlim(19,22) # errorDis1.set_xlabel('time',size=50) # errorDis1.set_ylabel('MSE',size=50) -# errorDis1.plot(time,ofpt,'sk-',label='TFO-PT', linewidth=2.5, markersize=5,markerfacecolor='k',markeredgecolor='r') -# errorDis1.plot(time,fpt,'*r--',label='TF-P', linewidth = 2.5, markersize=5,markerfacecolor='r',markeredgecolor='k') +# errorDis1.plot(time,ofpt,'sk-',label='TPO-PT', linewidth=2.5, markersize=5,markerfacecolor='k',markeredgecolor='r') +# errorDis1.plot(time,fpt,'*r--',label='TP-P', linewidth = 2.5, markersize=5,markerfacecolor='r',markeredgecolor='k') # errorDis1.legend(bbox_to_anchor=(0.25, 1), prop={'size':40}) # plt.show() #elif graph == 13:#Impact of deployment methods - OFPT VS OFTT @@ -591,14 +1646,16 @@ def AutoLocatorInit(self): # #errorDis1.plot(time,ofpt,'*k-',label='OFPT', linewidth = 2.5, markersize=6,markerfacecolor='k',markeredgecolor='k') # errorDis1.legend(bbox_to_anchor=(1, 1), prop={'size':40}) # plt.show() -elif graph == 19:#different forecasting time - TFO-P vs TF-P - time = [0.2, 0.4, 0.6, 0.8, 1, 2] - occ = [2.81367649395, 2.72324523499, 2.89804996496, 2.90757317685, 2.85996496, 3.11718528831] - traf = [4.72950579968, 4.76761682691, 5.080508459, 5.08152992209, 5.24693381719, 5.32249324451] + +elif graph == 19.1:#different prediction time - TPO-T vs TP-T +#TPO-T V.S. TP-T: Mean MSE on 20:00 - 22:00, as a function of prediction length. + time = [0.2, 0.4, 0.6, 0.8, 1, 1.2, 1.4, 1.6, 1.8, 2] + occ = [3.49423864183, 3.49407962963, 3.49418338963, 3.49420338963, 3.49447537026, 3.49461046928, 3.4947523369, 3.49625917075, 3.49653884244, 3.49680735464] + traf = [6.34534391535, 6.34534391535, 6.34534391535, 6.34534391535, 6.34534391535, 6.34534391535, 6.34534391535, 6.34534391535, 6.34534391535, 6.34534391535] print 'MEAN - occ: ',np.mean(occ) print 'MEAN - traf:', np.mean(traf) #ylim(0,40) - xlim(0.2,1) + xlim(0.2,2) fig = plt.figure(1) errorDis1 = plt.subplot(1,1,1) ax=plt.gca() @@ -606,11 +1663,12 @@ def AutoLocatorInit(self): tick.label1.set_fontsize(40) for tick in ax.yaxis.get_major_ticks(): tick.label1.set_fontsize(40) - errorDis1.set_xlabel('Forecasting Length (hour)',size=50) + errorDis1.set_xlabel('Prediction Length (hour)',size=50) errorDis1.set_ylabel('Mean MSE',size=50) - errorDis1.plot(time,occ,'sk-',label='TFO-P', linewidth=2.5, markersize=30,markerfacecolor='k',markeredgecolor='k') - errorDis1.plot(time,traf,'*r--',label='TF-P', linewidth = 2.5, markersize=40,markerfacecolor='r',markeredgecolor='r') - errorDis1.legend(bbox_to_anchor=(0.3, 1.03), prop={'size':40}) + errorDis1.plot(time,occ,'sk-',label='TPO-T', linewidth=2.5, markersize=30,markerfacecolor='k',markeredgecolor='k') + errorDis1.plot(time,traf,'*r--',label='TP-T', linewidth = 2.5, markersize=40,markerfacecolor='r',markeredgecolor='r') + errorDis1.legend(bbox_to_anchor=(0.3, 0.53), prop={'size':40}) + plt.grid(True, linewidth = 3) plt.show() #elif graph == 20:#weight of occupancy - different prediction time # time = [0.2, 0.4, 0.6, 0.8, 1, 1.2] @@ -633,42 +1691,11 @@ def AutoLocatorInit(self): # tick.label1.set_fontsize(40) # errorDis1.set_xlabel('prediction time',size=50) # errorDis1.set_ylabel('weight',size=50) -# errorDis1.plot(time,occ,'ok-',label='TFO-PT', linewidth=2.5, markersize=6,markerfacecolor='w',markeredgecolor='k') -# errorDis1.plot(time,traf,'vr--',label='TF-P', linewidth = 2.5, markersize=6,markerfacecolor='w',markeredgecolor='r') +# errorDis1.plot(time,occ,'ok-',label='TPO-PT', linewidth=2.5, markersize=6,markerfacecolor='w',markeredgecolor='k') +# errorDis1.plot(time,traf,'vr--',label='TP-P', linewidth = 2.5, markersize=6,markerfacecolor='w',markeredgecolor='r') # errorDis1.legend(bbox_to_anchor=(0.3, 1), prop={'size':40}) # plt.show() -elif graph == 21:#weight of occupancy/traffic - different prediction time - time = [0.2, 0.4, 0.6, 0.8, 1, 1.2] - occ = [1.33620255151, 4.95949772586, 1.26187717795, 0.990177728744, 1.2777695719, 0.0484706064585] - traf = [1,1,1,1,1,1] - - #traf = [0.0108831159948, 0.0108958069672, 0.0629231822061, 0.0615828235894, 0.0629231822061, 0.0143713279428] - #0.0145420473606 0.0540377298752 0.0794013275901 0.0609779403914 0.0804013275901 0.00206971826242 0.0389080100848 0.0191253722211 - #0.0108831159948 0.0108958069672 0.0629231822061 0.0615828235894 0.0629231822061 0.0427004820786 0.0287928551123 0.0143713279428 - - print 'MEAN - occ/traf: ',np.mean(occ) - #print 'MEAN - traf:', np.mean(traf) - - fig = plt.figure(1) - errorDis1 = plt.subplot(1,1,1) - ax=plt.gca() - for tick in ax.xaxis.get_major_ticks(): - tick.label1.set_fontsize(40) - for tick in ax.yaxis.get_major_ticks(): - tick.label1.set_fontsize(40) - ax.set_yticks(np.linspace(0,5,6)) - ax.set_yticklabels( ('0', '1', '2', '3', '4', '5')) - ax.set_xticks(np.linspace(0,1.2,7)) - ax.set_xticklabels( ('0', '0.2', '0.4', '0.6', '0.8', '1', '1.2')) - errorDis1.set_xlabel('Forecasting Length (hour)',size=50) - errorDis1.set_ylabel('The Ratio of Weight',size=50) - errorDis1.plot(time,occ,'sk-',label='Occupancy/Traffic', linewidth=2.5, markersize=30,markerfacecolor='k',markeredgecolor='k') - errorDis1.plot(time,traf,'r--', linewidth = 2.5, markersize=40,markerfacecolor='r',markeredgecolor='r') - errorDis1.legend(bbox_to_anchor=(1, 1), prop={'size':40}) - plt.show() - ylim(-0.5,5.2) - xlim(0.179,1.22) #elif graph == 22:#overview 2a different training time # time = [2,4,6,8,10,12] # occ = [10.8529139633, 4.07865387387, 3.38408769104, 3.06303387774,3.04027656595,2.74723547149] @@ -691,11 +1718,11 @@ def AutoLocatorInit(self): # tick.label1.set_fontsize(40) # errorDis1.set_xlabel('training time',size=50) # errorDis1.set_ylabel('MSE',size=50) -# errorDis1.plot(time,occ,'ok-',label='TFO-PT', linewidth=2.5, markersize=6,markerfacecolor='w',markeredgecolor='k') -# #errorDis1.plot(time,traf,'vr--',label='TF-P/TF-P', linewidth = 2.5, markersize=6,markerfacecolor='w',markeredgecolor='r') +# errorDis1.plot(time,occ,'ok-',label='TPO-PT', linewidth=2.5, markersize=6,markerfacecolor='w',markeredgecolor='k') +# #errorDis1.plot(time,traf,'vr--',label='TP-P/TP-P', linewidth = 2.5, markersize=6,markerfacecolor='w',markeredgecolor='r') # errorDis1.legend(bbox_to_anchor=(1, 1), prop={'size':40}) # plt.show() -elif graph == 23: #today data VS last week data - traf +elif graph == 23.4: #today data VS last week data - traf weeks = [1, 2, 3, 4, 5, 6, 7, 8] msew = [7.125, 7.57142857143, 7.14285714286, 5.98214285714, 5.96428571429, 6.46428571429, 4.19642857143, 4.92857142857] hours = [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8] @@ -757,7 +1784,7 @@ def AutoLocatorInit(self): #plt.draw() plt.show() -#elif graph == 24:#TFO-PT VS TFO-SPT in EV, 3 months training, 1 month testing +#elif graph == 24:#TPO-PT VS TPO-SPT in EV, 3 months training, 1 month testing # time1 = [ 15.0 , 15.1 , 15.2 , 15.3 , 15.4 , 15.5 , 15.6 , 15.7 , 15.8 , 15.9 , 16.0 , 16.1 , 16.2 , 16.3 , 16.4 , 16.5 , 16.6 , 16.7 , 16.8 , 16.9 , 17.0 , 17.1 , 17.2 , 17.3 , 17.4 , 17.5 , 17.6 , 17.7 , 17.8 , 17.9 , 18.0 , 18.1, 18.2 , 18.3 , 18.4 , 18.5 , 18.6 , 18.7 , 18.8 , 18.9 , 19.0 , 19.1 , 19.2 , 19.3 , 19.4 , 19.5 , 19.6 , 19.7 , 19.8 , 19.9 , 20.0 , 20.1 , 20.2 , 20.3 , 20.4 , 20.5 , 20.6 , 20.7 , 20.8 , 20.9, 21.0 , 21.1 , 21.2 , 21.3 , 21.4 , 21.5 , 21.6 , 21.7 , 21.8 , 21.9 , 22.0 , 22.1 , 22.2 , 22.3 , 22.4 , 22.5 , 22.6 , 22.7 , 22.8 , 22.9 , 23.0 , 23.1 , 23.2 , 23.3 , 23.4 , 23.5 , 23.6 , 23.7 , 23.8, 23.9 , 24.0] # occ1 = [ 3.33126992611 , 2.15235043881 , 4.21215375236 , 2.04146402499 , 2.26508236112 , 1.75842743987 , 3.83752010319 , 1.79356812562 , 2.71647871756 , 2.98920028076 , 3.06963761795 , 3.78037524154 , 2.11330949347 , 3.62306600989 , 2.10132375418 , 2.79890211351 , 2.45220911956 , 2.0962944359 , 1.71888897623 , 2.00237892092 , 1.36971503061 , 1.75017286044 , 1.87819485903 , 2.77200592938 , 0.927552735382 , 2.16110258543 , 0.952612535679 , 1.55876494568 , 2.43936505277 , 2.74032154014 , 2.20187230613 , 2.62732676781, 1.81709347884 , 2.68646819361 , 4.87840695719 , 3.58804992604 , 1.96027598281 , 2.16400733578 , 4.55698744552 , 2.61612107743 , 4.1007299461 , 2.60197595024 , 2.42772928849 , 3.70504358394 , 2.64089183244 , 2.53083484208 , 2.69596558723 , 3.82189848477 , 2.10858933652 , 2.69381421149 , 4.48942308279 , 3.48776778082 , 1.75831208948 , 1.48030854681 , 3.2901866737 , 2.33799936521 , 1.50491990853 , 1.23953538087 , 1.19008302381 , 2.36576100342, 2.57888534853 , 2.052794471 , 2.64644323686 , 1.35534774334 , 5.6573022579 , 4.76819909982 , 1.85043233584 , 3.46190356262 , 5.28356384041 , 1.84882416982 , 3.01211103176 , 4.59728665448 , 8.01181670627 , 6.44190774176 , 7.57429158629 , 5.66900034971 , 4.30244931982 , 6.23339404063 , 6.88638460847 , 4.63713969717 , 5.75838213042 , 3.38303474858 , 4.29114582128 , 2.74825804228 , 2.33363923855 , 2.26640425042 , 4.06245325649 , 3.02492973852 , 4.13263598916, 4.06968874886 , 3.87911988994] # ha1 = [ 3.7312510252 , 2.38592263828 , 2.67330207956 , 2.3562696227 , 2.46235555892 , 1.94224601755 , 3.74153934132 , 2.2949674808 , 3.13336998512 , 3.26076611749 , 2.6147343971 , 4.01572760269 , 1.95988720954 , 3.451438663 , 2.20709506049 , 3.32847903104 , 2.34290607601 , 2.0444927526 , 1.36423972748 , 1.754432254 , 1.33594434381 , 1.73757953638 , 2.32524007437 , 2.32866595174 , 0.522422263228 , 1.86583750608 , 1.00270616505 , 1.63000126756 , 2.30811844706 , 2.08056082117 , 2.11980314084 , 2.40932182991 , 1.70386804182 , 2.4905292818 , 3.55193722165 , 3.07332621401 , 2.57585333808 , 2.25824597719 , 3.74812118499 , 2.04741740671 , 3.74092252922 , 2.27863554173 , 2.4435919558 , 2.47782477621 , 2.55264270929 , 2.90733544911 , 3.45142599973 , 3.7378478315 , 2.38964354763 , 3.5411240839 , 3.9835438965 , 4.24102420913 , 2.53707864592 , 1.53338138369 , 3.47668683748 , 2.27456733723 , 1.70587416273 , 1.95482152915 , 1.79873657824 , 2.14137951729 , 2.73161901349 , 2.49054447854 , 2.92602828779 , 1.54379576916 , 13.4958824612 , 7.17559143096 , 5.62961282427 , 8.58632521278 , 11.9105687683 , 5.03106092181 , 2.95721345125 , 4.25331334679 , 7.0072019294 , 6.64121121257 , 6.08372965176 , 6.29265184095 , 4.74285634532 , 5.66860037478 , 5.06555966792 , 5.06833940864 , 5.38452528704 , 31.0442855478 , 16.5223509018 , 2.75200122425 , 19.662561423 , 2.51909960457 , 24.8021572024 , 27.0008148889 , 13.3302578298 , 15.52102529 , 3.43242558393 ] @@ -772,8 +1799,8 @@ def AutoLocatorInit(self): # occ.append(occ1[i]) # ha.append(ha1[i]) # break -# print 'TFO-PT', np.mean(occ) -# print 'TFO-SPT', np.mean(ha) +# print 'TPO-PT', np.mean(occ) +# print 'TPO-SPT', np.mean(ha) ## i=0 ## s = [] ## for i in range(len(occ)): @@ -794,64 +1821,11 @@ def AutoLocatorInit(self): # tick.label1.set_fontsize(40) # errorDis1.set_xlabel('time',size=50) # errorDis1.set_ylabel('MSE',size=50) -# errorDis1.plot(time,ha,'*r--',label='TFO-SPT', linewidth=2.5, markersize=25,markerfacecolor='r',markeredgecolor='r') -# errorDis1.plot(time,occ,'sk-',label='TFO-PT', linewidth = 2.5, markersize=20,markerfacecolor='k',markeredgecolor='k') +# errorDis1.plot(time,ha,'*r--',label='TPO-SPT', linewidth=2.5, markersize=25,markerfacecolor='r',markeredgecolor='r') +# errorDis1.plot(time,occ,'sk-',label='TPO-PT', linewidth = 2.5, markersize=20,markerfacecolor='k',markeredgecolor='k') # # errorDis1.legend(bbox_to_anchor=(0.37, 1), loc=0, borderaxespad=0.,prop={'size':40}) # plt.show() -elif graph == 25:#TFO-PT vs TF-P 150-240 - time1 =[ 15.0 , 15.1 , 15.2 , 15.3 , 15.4 , 15.5 , 15.6 , 15.7 , 15.8 , 15.9 , 16.0 , 16.1 , 16.2 , 16.3 , 16.4 , 16.5 , 16.6 , 16.7 , 16.8 , 16.9 , 17.0 , 17.1 , 17.2 , 17.3 , 17.4 , 17.5 , 17.6 , 17.7 , 17.8 , 17.9 , 18.0 , 18.1, 18.2 , 18.3 , 18.4 , 18.5 , 18.6 , 18.7 , 18.8 , 18.9 , 19.0 , 19.1 , 19.2 , 19.3 , 19.4 , 19.5 , 19.6 , 19.7 , 19.8 , 19.9 , 20.0 , 20.1 , 20.2 , 20.3 , 20.4 , 20.5 , 20.6 , 20.7 , 20.8 , 20.9, 21.0 , 21.1 , 21.2 , 21.3 , 21.4 , 21.5 , 21.6 , 21.7 , 21.8 , 21.9 , 22.0 , 22.1 , 22.2 , 22.3 , 22.4 , 22.5 , 22.6 , 22.7 , 22.8 , 22.9 , 23.0 , 23.1 , 23.2 , 23.3 , 23.4 , 23.5 , 23.6 , 23.7 , 23.8, 23.9 , 24.0] - #traf2 = [5.648282572 , 5.15543392949 , 5.23828111858 , 3.99522995564 , 6.40135656351 , 3.33011698012 , 3.42595792088 , 0.887920546277 , 4.9063025046 , 6.3892931963 , 4.77314847668 , 3.43746839542 , 5.67484375709 , 5.3297812159 , 4.30606192381 , 4.88982691265 , 2.7806659404 , 2.42147134238 , 1.56921401765 , 2.26569041117 , 2.05704237866 , 3.68825624997 , 2.62980613877 , 2.08601428096 , 2.15463120912 , 2.12097583292 , 4.0181020104 , 4.76136547779 , 1.51607823457 , 1.75588636357 , 3.67988553676 , 4.16254546425 , 3.89581340977 , 3.16968429168 , 4.3081855229 , 2.12780904865 , 1.02279538146 , 2.07169198145 , 3.7928610568 , 5.00395450386 , 4.65880327762 , 5.13929330473 , 3.66703817684 , 5.6542576756 , 6.3448215367 , 1.10267510654 , 1.75606711166 , 1.90362678901 , 2.37726986022 , 4.40801447609 , 10.7108819679 , 19.1123797487 , 21.9144168831 , 11.4729174715 , 26.1441100047 , 14.1112663432 , 12.2157467347 , 9.47224430272 , 7.76382406644 , 3.72067391465 , 6.27401352228 , 11.9575959907 , 27.0941596366 , 1.4149245575 , 1.08184704264 , 0.775724340466 , 0.763910275063 , 0.419415884139 , 0.428053058844 , 0.740069330471 , 2.44294731878, 4.57328849058 , 5.80687995343 , 6.95878485269 , 7.72893462061 , 7.02814142419 , 5.05219816438 , 5.44598003157 , 6.13105945609 , 4.38539146046 , 6.26051298642 , 7.82124811496 , 6.47002032166 , 10.1974933772 , 3.6415823182 , 8.26392144517 , 4.41229726097 , 3.56887666101 , 6.36807457898 , 6.53689879115 , 6.50894555372] - traf1 = [ 3.96618645819 , 4.04497622846 , 3.39075473611 , 4.7234606614 , 4.164909464 , 3.74929904373 , 3.90519374081 , 4.01099285863 , 4.64369992486 , 4.57965918692 , 2.82826888741 , 5.0604905316 , 3.99257536387 , 7.18455151752 , 2.36224254873 , 4.16547682492 , 3.34751996066 , 3.58983560969 , 2.43789160656 , 2.54892943846 , 2.54892943846 , 4.86102740209 , 4.39002674918 , 3.4733625116 , 1.65661314039 , 4.30196947144 , 1.85158868053 , 3.45453815456 , 8.26514748182 , 3.39325035825 , 3.05344100669 , 4.92566172441 , 3.90778176245 , 2.98940013899 , 7.03302763038 , 4.51793391538 , 5.11233797865 , 3.58112845539 , 5.31103060742 , 5.36028896036 , 4.68315982201 , 4.68057920356 , 10.2563604348 , 7.45090549345 , 3.48067021098 , 4.95830331286 , 6.78096463283 , 5.14312042025 , 2.79491732187 , 3.85133045544 , 4.39286091368 , 4.15029338914 , 2.69199038573 , 2.6877504365 , 6.18964671317 , 3.92690164743 , 1.4216195593 , 2.32972493884 , 2.68810883884 , 3.07620211093 , 8.10307709548 , 6.24938041557 , 4.41333952399 , 5.74221501923 , 4.89501154313 , 7.2711287331 , 9.07431829147 , 4.32086457158 , 8.21095270683 , 2.74730418402 , 3.6636698868 , 4.57328849058 , 5.80687995343 , 6.95878485269 , 7.72893462061 , 7.02814142419 , 5.05219816438 , 5.44598003157 , 6.13105945609 , 4.38539146046 , 6.26051298642 , 7.82124811496 , 6.47002032166 , 10.1974933772 , 3.6415823182 , 8.26392144517 , 4.41229726097 , 3.56887666101 , 6.36807457898 , 6.53689879115 , 6.50894555372 ] - #occ2 = [ 3.43376451284 , 2.13581708141 , 4.13807611836 , 2.0743030885 , 2.27616236115 , 1.8607885637 , 3.83699568065 , 1.79999159126 , 2.78347123675 , 2.97150955692 , 3.22515920191 , 3.77469326189 , 2.10891340907 , 3.56228204836 , 2.11759849524 , 2.86155397168 , 2.44420294786 , 2.08136370027 , 1.78131533164 , 1.75831115087 , 1.3581481954 , 1.750114629 , 1.85558526873 , 2.72589476056 , 0.978178657459 , 2.20088259943 , 1.01649730622 , 1.55876494568 , 2.46512850977 , 2.73349348778 , 2.20530283716 , 2.60485116759 , 1.81709347884 , 2.67734032855 , 4.88695604165 , 3.61947500178 , 2.06317604437 , 2.24747339295 , 4.66517200172 , 2.72909921161 , 4.07424859228 , 2.52072001884 , 2.45789059095 , 3.45650152966 , 3.28383640492 , 2.54359671034 , 2.56622425956 , 3.67248937226 , 2.2656097676 , 2.9166235183 , 4.2959598894 , 3.41415392555 , 3.10378068753 , 1.59076738622 , 3.32978753887 , 2.10842312598 , 1.97281508282 , 1.53253131361 , 1.0859348115 , 2.29921994879 , 2.84173764276 , 2.95858511647 , 2.55703502614 , 1.55138408102 , 11.8911415216 , 8.31134465283 , 5.12287932888 , 3.34617552468 , 8.79609117735 , 1.71426537655 , 2.92456086528 , 5.30314993131 , 8.23194976761 , 7.19222936391 , 7.20510601604 , 5.99792971854 , 4.32794739852 , 6.46748675904 , 6.80954443842 , 4.91883488077 , 6.31881648107 , 3.31512496675 , 4.79112079617 , 3.16999156393 , 3.54661149475 , 2.75919922857 , 3.98297779129 , 3.89795549457 , 4.02183350182 , 5.68572844005 , 8.03894474887 ] - occ1 = [ 3.33126992611 , 2.15235043881 , 4.21215375236 , 2.04146402499 , 2.26508236112 , 1.75842743987 , 3.83752010319 , 1.79356812562 , 2.71647871756 , 2.98920028076 , 3.06963761795 , 3.78037524154 , 2.11330949347 , 3.62306600989 , 2.10132375418 , 2.79890211351 , 2.45220911956 , 2.0962944359 , 1.71888897623 , 2.00237892092 , 2.00237892092 , 1.75017286044 , 1.87819485903 , 2.77200592938 , 0.927552735382 , 2.16110258543 , 0.952612535679 , 1.55876494568 , 2.43936505277 , 2.74032154014 , 2.20187230613 , 2.62732676781, 1.81709347884 , 2.68646819361 , 4.87840695719 , 3.58804992604 , 1.96027598281 , 2.16400733578 , 4.55698744552 , 2.61612107743 , 4.1007299461 , 2.60197595024 , 2.42772928849 , 3.70504358394 , 2.64089183244 , 2.53083484208 , 2.69596558723 , 3.82189848477 , 2.10858933652 , 2.69381421149 , 4.48942308279 , 3.48776778082 , 1.75831208948 , 1.48030854681 , 3.2901866737 , 2.33799936521 , 1.50491990853 , 1.23953538087 , 1.19008302381 , 2.36576100342, 2.57888534853 , 2.052794471 , 2.64644323686 , 1.35534774334 , 5.6573022579 , 4.76819909982 , 1.85043233584 , 3.46190356262 , 5.28356384041 , 1.84882416982 , 3.01211103176 , 4.59728665448 , 8.01181670627 , 6.44190774176 , 7.57429158629 , 5.66900034971 , 4.30244931982 , 6.23339404063 , 6.88638460847 , 4.63713969717 , 5.75838213042 , 3.38303474858 , 4.29114582128 , 2.74825804228 , 2.33363923855 , 2.26640425042 , 4.06245325649 , 3.02492973852 , 4.13263598916, 4.06968874886 , 3.87911988994] - - time = [] - traf= [] - occ = [] - for time10 in range(160,240,10): - time01 = time10 / 10.0 - - for i in range(len(time1)): - if time1[i] == time01: - if time1[i] == 21: - print (traf1[i]-occ1[i])/traf1[i] - time.append(time1[i]) - traf.append(traf1[i]) - occ.append(occ1[i]) - break - - time.append(time1[-1]) - traf.append(traf1[-1]) - occ.append(occ1[-1]) - print 'MEAN -occ: ',np.mean(occ) - print 'MEAN - traf:', np.mean(traf) -# cntT = 0 -# cntO = 0 -# for i in range(len(traf)): -# if traf[i] < occ[i]: -# cntT += 1 -# else: -# cntO += 1 -# print "T win: ", cntT -# print "O win: ", cntO - - #xlim(20,22) - xlim(16,24) - ylim(0,10) - fig = plt.figure(1) - errorDis1 = plt.subplot(1,1,1) - ax=plt.gca() - for tick in ax.xaxis.get_major_ticks(): - tick.label1.set_fontsize(40) - for tick in ax.yaxis.get_major_ticks(): - tick.label1.set_fontsize(40) - errorDis1.set_xlabel('Time',size=50) - errorDis1.set_ylabel('MSE',size=50) - errorDis1.plot(time,occ,'sk-',label='TFO-P', linewidth=2.5, markersize=30,markerfacecolor='k',markeredgecolor='k') - errorDis1.plot(time,traf,'*r--',label='TF-P', linewidth = 2.5, markersize=40,markerfacecolor='r',markeredgecolor='r') - errorDis1.legend(bbox_to_anchor=(0.30, 1), prop={'size':40}) - plt.show() elif graph == 26:#May vs June for July time1 =[ 15.0 , 15.1 , 15.2 , 15.3 , 15.4 , 15.5 , 15.6 , 15.7 , 15.8 , 15.9 , 16.0 , 16.1 , 16.2 , 16.3 , 16.4 , 16.5 , 16.6 , 16.7 , 16.8 , 16.9 , 17.0 , 17.1 , 17.2 , 17.3 , 17.4 , 17.5 , 17.6 , 17.7 , 17.8 , 17.9 , 18.0 , 18.1, 18.2 , 18.3 , 18.4 , 18.5 , 18.6 , 18.7 , 18.8 , 18.9 , 19.0 , 19.1 , 19.2 , 19.3 , 19.4 , 19.5 , 19.6 , 19.7 , 19.8 , 19.9 , 20.0 , 20.1 , 20.2 , 20.3 , 20.4 , 20.5 , 20.6 , 20.7 , 20.8 , 20.9, 21.0 , 21.1 , 21.2 , 21.3 , 21.4 , 21.5 , 21.6 , 21.7 , 21.8 , 21.9 , 22.0 , 22.1 , 22.2 , 22.3 , 22.4 , 22.5 , 22.6 , 22.7 , 22.8 , 22.9 , 23.0 , 23.1 , 23.2 , 23.3 , 23.4 , 23.5 , 23.6 , 23.7 , 23.8, 23.9 , 24.0] traf1 = [ 2.66061144883 , 1.99805109687 , 1.19505013529 , 1.889250346 , 1.39292556291 , 1.51453893215 , 2.78728097123 , 1.80862785601 , 2.33550462373 , 2.18499059864 , 1.75367281777 , 1.045375756 , 1.98149485924 , 1.87135433346 , 1.62507744752 , 1.89731724564 , 2.05467360628 , 1.75044695512 , 2.84819613654 , 2.87639018654 , 2.24893774892 , 1.34277240354 , 2.18219856809 , 3.5323089324 , 1.83377119694 , 1.53291173216 , 1.6644965285 , 0.989357474255 , 1.23985056409 , 1.30073443669 , 1.68088823374 , 2.45664181894 , 2.33047585982 , 1.57446978292 , 2.07036963195 , 2.87312481853 , 2.2873490848 , 7.77671252499 , 5.09898621009 , 2.33167338743 , 2.52558691822 , 3.36823994869 , 2.7143301734 , 2.1667222719 , 3.24920070848 , 2.43708934422 , 2.82231254222 , 1.68084555425 , 2.18474438173 , 5.13967167847 , 3.30347222445 , 5.81172032324 , 3.05900630454 , 6.506739254 , 2.40445337434 , 2.26599263486 , 2.89637107122 , 2.30793083989 , 0.732806924045 , 0.604381369616 , 8.590407054 , 4.32575747881 , 1.9139987444 , 2.94714406403 , 0.783684012338 , 2.25925034037 , 4.04742152297 , 3.6204428073 , 7.08077516712 , 1.93547939814 , 5.94159810864 , 4.62208465747 , 5.55935890218 , 6.99255730061 , 4.98341409941 , 7.49848667855 , 3.97971717422 , 3.49645283558 , 2.47275618805 , 3.33028382907 , 3.24779109169 , 2.0798503699 , 4.00362114092 , 2.42625144139 , 1.42120559831 , 1.71377786686 , 2.45911287204 , 5.98252381957 , 2.51050360787 , 2.49122699117 , 2.45050623571 ] @@ -946,14 +1920,14 @@ def AutoLocatorInit(self): errorDis1.plot(time,July,'sk-',label='July', linewidth=2.5, markersize=30,markerfacecolor='k',markeredgecolor='k') errorDis1.legend(bbox_to_anchor=(1, 1), prop={'size':40}) plt.show() -#elif graph == 28:#TFO-PT / TF-P / TFO-PT' +#elif graph == 28:#TPO-PT / TP-P / TPO-PT' # time =[ 15.0 , 15.5 , 16.0 , 16.5 , 17.0 , 17.5 , 18.0 , 18.5 , 19.0 , 19.5 ] # July = [ 4.36759200333 , 6.22522569185 , 4.73666267918 , 5.24693144635 , 1.34942144914 , 4.01236048552 , 3.16016929798 , 8.53144861928 , 7.28522921891 , 3.24215314546 ] # June = [3.33126992611, 1.75842743987, 3.06963761795, 2.79890211351, 1.36971503061, 2.16110258543, 2.20187230613, 3.58804992604, 4.1007299461, 1.10267510654] # May = [5.648282572, 3.33011698012, 4.77314847668, 4.88982691265, 2.05704237866, 2.12097583292, 3.67988553676, 2.12780904865, 4.65880327762, 2.53083484208] -# print "MEAN - TFO-PT': ",np.mean(July) -# print 'MEAN - TFO-PT:', np.mean(June) -# print 'MEAN - TF-P:', np.mean(May) +# print "MEAN - TPO-PT': ",np.mean(July) +# print 'MEAN - TPO-PT:', np.mean(June) +# print 'MEAN - TP-P:', np.mean(May) # cntT = 0 # cntO = 0 # for i in range(len(traf)): @@ -961,8 +1935,8 @@ def AutoLocatorInit(self): # cntT += 1 # else: # cntO += 1 -# print "TFO-PT win: ", cntT -# print "TF-P win: ", cntO +# print "TPO-PT win: ", cntT +# print "TP-P win: ", cntO # # xlim(15, 20) # ylim(0,10) @@ -975,12 +1949,13 @@ def AutoLocatorInit(self): # tick.label1.set_fontsize(40) # errorDis1.set_xlabel('training time(hour)',size=50) # errorDis1.set_ylabel('MSE',size=50) -# errorDis1.plot(time,May,'*r--',label='TF-P', linewidth = 2.5, markersize=25,markerfacecolor='r',markeredgecolor='r') -# errorDis1.plot(time,June,'^b-',label='TFO-PT', linewidth = 2.5, markersize=25,markerfacecolor='b',markeredgecolor='b') -# errorDis1.plot(time,July,'sk-',label="TFO-PT'", linewidth=2.5, markersize=20,markerfacecolor='k',markeredgecolor='k') +# errorDis1.plot(time,May,'*r--',label='TP-P', linewidth = 2.5, markersize=25,markerfacecolor='r',markeredgecolor='r') +# errorDis1.plot(time,June,'^b-',label='TPO-PT', linewidth = 2.5, markersize=25,markerfacecolor='b',markeredgecolor='b') +# errorDis1.plot(time,July,'sk-',label="TPO-PT'", linewidth=2.5, markersize=20,markerfacecolor='k',markeredgecolor='k') # errorDis1.legend(bbox_to_anchor=(0.23, 1.1), prop={'size':40}) # plt.show() -elif graph == 29: #cdf of TFO-PT and TF-P + +elif graph == 30: #cdf of TPO-T and TP-T import numpy as np from sklearn.metrics import mean_squared_error import matplotlib.pyplot as plt @@ -992,43 +1967,39 @@ def AutoLocatorInit(self): plt.rcParams['axes.labelsize'] = 50 time = 21 - if time == 16.0: - Real = [58.0, 59.0, 67.0, 59.0, 58.0, 56.0, 58.0, 60.0, 57.0, 63.0, 60.0, 59.0, 60.0, 56.0, 58.0, 62.0, 66.0, 58.0, 59.0, 61.0, 57.0, 60.0, 56.0, 62.0, 59.0, 62.0, 57.0, 62.0, 57.0, 58.0] - traflwr = [58.6109092467781, 59.050695650762634, 64.00413230201886, 57.902966650678863, 60.19655260893694, 57.463925700868806, 59.050975841849045, 59.050585666425299, 58.667950803699803, 66.040904141199164, 57.350234759976644, 59.050467761293305, 59.872036985561536, 57.463463368263582, 59.432766715940346, 59.992725070311501, 66.70279919414584, 58.285889317765616, 59.756016898223095, 59.107508506517277, 59.050840905634246, 58.668286532485396, 57.788039112440018, 65.38677071898087, 58.610727580298665, 60.196636361088984, 56.968608886515923, 59.98625175354973, 58.112541296752063, 59.988382536151555] + if time == 19.0: + #Real = [69.0, 69.0, 58.0, 59.0, 56.0, 62.0, 59.0, 69.0, 56.0, 59.0, 59.0, 58.0, 58.0, 58.0, 69.0, 62.0, 58.0, 59.0, 59.0, 57.0, 57.0, 65.0, 59.0, 60.0, 59.0, 58.0, 59.0, 59.0, 61.0, 60.0, 69.0, 61.0, 57.0, 58.0, 58.0, 69.0, 56.0, 57.0, 59.0, 58.0, 60.0, 59.0, 64.0, 60.0, 58.0, 58.0, 59.0, 58.0, 60.0, 67.0, 61.0, 57.0, 59.0, 57.0, 59.0, 59.0, 62.0, 59.0, 59.0, 62.0, 59.0, 61.0, 67.0, 58.0, 59.0, 60.0, 59.0, 60.0, 56.0, 69.0, 56.0, 60.0, 62.0, 59.0, 60.0, 59.0, 66.0, 62.0, 62.0, 58.0, 62.0, 59.0, 58.0, 69.0, 62.0, 59.0, 60.0, 56.0, 58.0, 60.0] + #Ha = [59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5] + Real = [69.0, 69.0, 58.0, 59.0, 56.0, 62.0, 59.0, 69.0, 56.0, 59.0, 59.0, 58.0, 58.0, 58.0, 69.0, 62.0, 58.0, 59.0, 59.0, 57.0, 57.0, 65.0, 59.0, 60.0, 59.0, 58.0, 59.0, 59.0, 61.0, 60.0, 69.0, 61.0, 57.0, 58.0, 58.0, 69.0, 56.0, 57.0, 59.0, 58.0, 60.0, 59.0, 64.0, 60.0, 58.0, 58.0, 59.0, 58.0, 60.0, 67.0, 61.0, 57.0, 59.0, 57.0, 59.0, 59.0, 62.0, 59.0, 59.0, 62.0, 59.0, 61.0, 67.0, 58.0, 59.0, 60.0, 59.0, 60.0, 56.0, 69.0, 56.0, 60.0, 62.0, 59.0, 60.0, 59.0, 66.0, 62.0, 62.0, 58.0, 62.0, 59.0, 58.0, 69.0, 62.0, 59.0, 60.0, 56.0, 58.0, 60.0] + Ha = [59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5] elif time == 17.0: - Real = [59.0, 58.0, 67.0, 59.0, 59.0, 60.0, 56.0, 59.0, 56.0, 68.0, 59.0, 59.0, 59.0, 59.0, 60.0, 56.0, 67.0, 59.0, 60.0, 59.0, 59.0, 62.0, 56.0, 67.0, 58.0, 58.0, 59.0, 57.0, 58.0, 56.0] - traflwr = [57.00448927188409, 60.076068033248177, 65.229508652821991, 59.102093311927568, 58.947406572774099, 57.178362690652982, 58.46157802538665, 61.201192631123362, 59.276218318372436, 64.119741791659052, 59.744172153908039, 58.13139195479534, 59.745312018925716, 57.178476157887765, 59.913966695996557, 60.54031318107571, 65.559249422289071, 57.004584926098687, 59.587479029834157, 60.870959492073013, 56.363721577004178, 60.228777235570213, 56.693233333701286, 64.942504567754142, 59.102254913406298, 60.541925649016733, 57.820258977118364, 62.486284487635629, 57.819813111332948, 57.00483713939569] + #Real = [66.0, 71.0, 59.0, 59.0, 57.0, 62.0, 56.0, 71.0, 59.0, 59.0, 59.0, 60.0, 60.0, 57.0, 68.0, 59.0, 59.0, 59.0, 59.0, 59.0, 62.0, 66.0, 57.0, 60.0, 58.0, 57.0, 56.0, 56.0, 70.0, 59.0, 66.0, 59.0, 59.0, 60.0, 56.0, 64.0, 59.0, 59.0, 61.0, 58.0, 59.0, 56.0, 67.0, 59.0, 59.0, 59.0, 59.0, 58.0, 62.0, 67.0, 59.0, 56.0, 59.0, 57.0, 59.0, 62.0, 65.0, 59.0, 59.0, 60.0, 59.0, 58.0, 67.0, 59.0, 59.0, 60.0, 56.0, 59.0, 56.0, 68.0, 59.0, 59.0, 59.0, 59.0, 60.0, 56.0, 67.0, 59.0, 60.0, 59.0, 59.0, 62.0, 56.0, 67.0, 58.0, 58.0, 59.0, 57.0, 58.0, 56.0] + #Ha = [59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308] + Real = [66.0, 71.0, 59.0, 59.0, 57.0, 62.0, 56.0, 71.0, 59.0, 59.0, 59.0, 60.0, 60.0, 57.0, 68.0, 59.0, 59.0, 59.0, 59.0, 59.0, 62.0, 66.0, 57.0, 60.0, 58.0, 57.0, 56.0, 56.0, 70.0, 59.0, 66.0, 59.0, 59.0, 60.0, 56.0, 64.0, 59.0, 59.0, 61.0, 58.0, 59.0, 56.0, 67.0, 59.0, 59.0, 59.0, 59.0, 58.0, 62.0, 67.0, 59.0, 56.0, 59.0, 57.0, 59.0, 62.0, 65.0, 59.0, 59.0, 60.0, 59.0, 58.0, 67.0, 59.0, 59.0, 60.0, 56.0, 59.0, 56.0, 68.0, 59.0, 59.0, 59.0, 59.0, 60.0, 56.0, 67.0, 59.0, 60.0, 59.0, 59.0, 62.0, 56.0, 67.0, 58.0, 58.0, 59.0, 57.0, 58.0, 56.0] + Ha = [59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308] elif time == 18.0: Real = [58.0, 56.0, 64.0, 60.0, 59.0, 59.0, 58.0, 59.0, 60.0, 64.0, 58.0, 62.0, 58.0, 59.0, 59.0, 61.0, 62.0, 60.0, 56.0, 57.0, 59.0, 57.0, 59.0, 66.0, 59.0, 56.0, 59.0, 59.0, 56.0, 58.0] - traflwr = [59.076751782795007, 58.773590296953373, 63.046163642548272, 59.231102588615478, 58.614077114865161, 58.763073759986881, 57.396575065996089, 58.768215134917298, 57.090483996737838, 63.502622917275886, 58.614074873126192, 58.768215134917298, 58.768031159138474, 58.460301825405971, 59.224816324581703, 56.938005068065237, 63.045561138077232, 58.768013735450381, 59.070426206029964, 58.922384132567622, 58.76822484887024, 59.829151591099915, 57.552570126873725, 63.676141410442625, 58.311540246964547, 58.157335692564629, 58.613912197044918, 57.854841751585923, 58.157801781915467, 56.93720228451491] - elif time == 19.0: - Real = [59.0, 61.0, 67.0, 58.0, 59.0, 60.0, 59.0, 60.0, 56.0, 69.0, 56.0, 60.0, 62.0, 59.0, 60.0, 59.0, 66.0, 62.0, 62.0, 58.0, 62.0, 59.0, 58.0, 69.0, 62.0, 59.0, 60.0, 56.0, 58.0, 60.0] - traflwr = [58.344934243257541, 59.272907138228305, 65.811375986303304, 59.742264968267726, 60.668799601948095, 59.275134042727984, 58.808421956763169, 59.739848339396403, 59.278219477321414, 65.345845598353023, 58.808982292853528, 59.284701068115858, 58.345118601322888, 59.275832292071087, 59.739715263681923, 58.818593529508178, 63.475172445202254, 59.741106957417088, 57.875596832948517, 58.342339240373462, 59.275471681633313, 59.736918135601172, 60.204177530078162, 66.73208743619783, 58.811519393848144, 57.875850093314263, 59.275160313625001, 60.669114664659645, 58.340430336616457, 58.345279741433053] - elif time == 20.5: - Real = [58.0, 59.0, 67.0, 60.0, 59.0, 59.0, 59.0, 59.0, 59.0, 66.0, 58.0, 57.0, 59.0, 59.0, 58.0, 61.0, 67.0, 58.0, 57.0, 62.0, 62.0, 62.0, 59.0, 68.0, 59.0, 59.0, 58.0, 59.0, 59.0, 60.0] - traflwr = [56.842804354796073, 59.147202979031952, 66.706229416640568, 58.562111778093112, 60.037402006730886, 59.76263962172532, 59.424076488839177, 60.279953047073491, 60.03892597560413, 63.51338309904984, 59.145313206652155, 58.807291896629508, 58.870944830801157, 59.420912412188365, 59.115392926290696, 58.838329581046551, 63.86243647987861, 60.005764246936735, 60.83461923884375, 59.976534877205218, 57.394739712077772, 58.562626393240308, 58.838167723513074, 64.098629440548237, 59.421606576689925, 58.867966760691026, 60.008236865650737, 61.176108849972366, 57.394806878248723, 60.622772148640898] - elif time == 21.0: - Real = [67.0, 65.0, 67.0, 62.0, 62.0, 63.0, 63.0, 64.0, 67.0, 68.0, 63.0, 63.0, 67.0, 62.0, 63.0, 70.0, 67.0, 63.0, 67.0, 63.0, 63.0, 61.0, 71.0, 67.0, 63.0, 62.0, 63.0, 63.0, 64.0, 73.0] - traflwr = [65.870340134926678, 65.026037581466525, 65.948163465176449, 64.977649955657313, 64.927417951671018, 64.915616170947317, 65.447637754705013, 64.333302903930075, 65.680165521385589, 66.485451570592986, 64.806251643916497, 65.806899354258178, 64.915071443375581, 64.321983138880299, 64.804202801354833, 64.742391697873373, 66.308671988115009, 65.211223200974445, 65.618519021631059, 64.928303283400282, 64.572308099480011, 64.976886250467516, 64.790454859220858, 66.485023164067101, 65.744999704699083, 64.977493285649018, 64.557153815581614, 65.399055603007099, 64.792170194005678, 64.976643269850229] + Ha = [59.333333333333336, 59.333333333333336, 59.333333333333336, 59.333333333333336, 59.333333333333336, 59.333333333333336, 59.333333333333336, 59.333333333333336, 59.333333333333336, 59.333333333333336, 59.333333333333336, 59.333333333333336, 59.333333333333336, 59.333333333333336, 59.333333333333336, 59.333333333333336, 59.333333333333336, 59.333333333333336, 59.333333333333336, 59.333333333333336, 59.333333333333336, 59.333333333333336, 59.333333333333336, 59.333333333333336, 59.333333333333336, 59.333333333333336, 59.333333333333336, 59.333333333333336, 59.333333333333336, 59.333333333333336] elif time == 20.0: Real = [62.0, 56.0, 63.0, 59.0, 62.0, 58.0, 59.0, 60.0, 59.0, 64.0, 60.0, 61.0, 58.0, 56.0, 60.0, 59.0, 65.0, 59.0, 58.0, 62.0, 60.0, 59.0, 56.0, 64.0, 60.0, 59.0, 56.0, 62.0, 56.0, 59.0] - traflwr = [58.898108852462904, 59.715162972333424, 64.191838953617733, 58.997079449805057, 59.236393300599445, 58.798746308931158, 59.576262501351465, 58.799643963917276, 58.180483997660303, 62.97377997733394, 58.518400385545384, 59.137718456352793, 59.614598948078019, 59.575530699780479, 59.815114244294676, 59.236150336764872, 62.93981183835772, 59.953701668968016, 59.277524397341779, 59.338322595623751, 59.954210054355954, 58.559281669060155, 59.336890042238373, 63.989981643877506, 59.953872691945982, 58.219137592367574, 59.814210407941744, 57.839695414114423, 60.015824429702377, 59.476049390977593] + Ha = [60.0, 60.0, 60.0, 60.0, 60.0, 60.0, 60.0, 60.0, 60.0, 60.0, 60.0, 60.0, 60.0, 60.0, 60.0, 60.0, 60.0, 60.0, 60.0, 60.0, 60.0, 60.0, 60.0, 60.0, 60.0, 60.0, 60.0, 60.0, 60.0, 60.0] + elif time == 21.0: + #Real = [67.0, 67.0, 63.0, 63.0, 63.0, 63.0, 73.0, 67.0, 66.0, 63.0, 66.0, 63.0, 64.0, 73.0, 67.0, 63.0, 64.0, 63.0, 63.0, 63.0, 73.0, 67.0, 65.0, 63.0, 64.0, 60.0, 63.0, 72.0, 67.0, 60.0, 67.0, 63.0, 64.0, 63.0, 73.0, 67.0, 63.0, 63.0, 63.0, 67.0, 63.0, 69.0, 67.0, 63.0, 67.0, 65.0, 65.0, 63.0, 70.0, 67.0, 63.0, 65.0, 63.0, 63.0, 64.0, 73.0, 71.0, 65.0, 63.0, 64.0, 67.0, 65.0, 67.0, 62.0, 62.0, 63.0, 63.0, 64.0, 67.0, 68.0, 63.0, 63.0, 67.0, 62.0, 63.0, 70.0, 67.0, 63.0, 67.0, 63.0, 63.0, 61.0, 71.0, 67.0, 63.0, 62.0, 63.0, 63.0, 64.0, 73.0] + #Ha = [64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307] + Real = [67.0, 67.0, 63.0, 63.0, 63.0, 63.0, 73.0, 67.0, 66.0, 63.0, 66.0, 63.0, 64.0, 73.0, 67.0, 63.0, 64.0, 63.0, 63.0, 63.0, 73.0, 67.0, 65.0, 63.0, 64.0, 60.0, 63.0, 72.0, 67.0, 60.0, 67.0, 63.0, 64.0, 63.0, 73.0, 67.0, 63.0, 63.0, 63.0, 67.0, 63.0, 69.0, 67.0, 63.0, 67.0, 65.0, 65.0, 63.0, 70.0, 67.0, 63.0, 65.0, 63.0, 63.0, 64.0, 73.0, 71.0, 65.0, 63.0, 64.0, 67.0, 65.0, 67.0, 62.0, 62.0, 63.0, 63.0, 64.0, 67.0, 68.0, 63.0, 63.0, 67.0, 62.0, 63.0, 70.0, 67.0, 63.0, 67.0, 63.0, 63.0, 61.0, 71.0, 67.0, 63.0, 62.0, 63.0, 63.0, 64.0, 73.0] + Ha = [64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307] elif time == 22.0: Real = [66.0, 69.0, 66.0, 65.0, 66.0, 70.0, 66.0, 63.0, 65.0, 68.0, 66.0, 68.0, 64.0, 65.0, 66.0, 66.0, 69.0, 65.0, 66.0, 66.0, 64.0, 70.0, 69.0, 70.0, 65.0, 66.0, 66.0, 65.0, 66.0, 69.0] - traflwr = [67.204897095112045, 66.56733143572616, 68.472780477204154, 65.700441657828122, 65.339746178495204, 65.568336524732445, 66.289034123771202, 65.97771154388505, 67.747436505325538, 69.064077637630476, 65.568693625711731, 65.568336524732445, 67.204689833325261, 64.979207025422227, 65.388083146611649, 67.888920825194404, 67.928947356760602, 65.568251582293087, 67.024367213958712, 65.568642916573623, 65.568149202996793, 64.749488870390891, 69.382944037587379, 68.836204464662373, 65.388026641973511, 64.979070141623311, 65.568234053212009, 65.929157233213999, 65.977640378328886, 70.200033594911105] - elif time == 21.5: - Real = [62.0, 69.0, 73.0, 65.0, 65.0, 64.0, 65.0, 70.0, 70.0, 65.0, 65.0, 62.0, 65.0, 65.0, 66.0, 70.0, 68.0, 69.0, 66.0, 66.0, 62.0, 67.0, 69.0, 73.0, 66.0, 65.0, 66.0, 67.0, 66.0, 70.0] - traflwr = [65.792920708610879, 65.7697668201358, 67.651944259582322, 65.939338809978821, 65.769440585449402, 65.834064110948944, 65.704450888345292, 65.963064688601605, 65.575390162021364, 67.728397312732184, 65.600416372145915, 65.430605604321556, 65.833877647094894, 65.769678722410504, 65.405057622423229, 66.04379282460998, 67.904294173280491, 65.599511844769538, 65.432038784157726, 66.28119078419445, 66.084832331923323, 66.472749689767966, 65.770246110494483, 67.639583504364722, 65.704793856243299, 65.769608309209502, 65.599905513726668, 65.96285088588742, 65.639327163858923, 65.939529345553467] - print mean_squared_error(Real, traflwr) - + Ha = [66.700000000000003, 66.700000000000003, 66.700000000000003, 66.700000000000003, 66.700000000000003, 66.700000000000003, 66.700000000000003, 66.700000000000003, 66.700000000000003, 66.700000000000003, 66.700000000000003, 66.700000000000003, 66.700000000000003, 66.700000000000003, 66.700000000000003, 66.700000000000003, 66.700000000000003, 66.700000000000003, 66.700000000000003, 66.700000000000003, 66.700000000000003, 66.700000000000003, 66.700000000000003, 66.700000000000003, 66.700000000000003, 66.700000000000003, 66.700000000000003, 66.700000000000003, 66.700000000000003, 66.700000000000003] + + print mean_squared_error(Real, Ha) mse = [] - for i in range(100): - mse.append(0) - + for i in range(135): + mse.append(0) MSE = [] cnt = 0 for i in range(len(Real)): - temp = int(np.ceil((traflwr[i] - Real[i])*(traflwr[i] - Real[i]))) + temp = int(np.ceil((Ha[i] - Real[i])*(Ha[i] - Real[i]))) print temp mse[temp] += 1 cnt += 1 @@ -1054,50 +2025,50 @@ def AutoLocatorInit(self): #print X #print Y #ylim(min(Y),max(Y)+0.01) - xlim(min(X)-0.1,15) - plt.step(X, Y,'.r-',label='TF-P', linewidth = 3.5,markersize=20) + #xlim(min(X)-0.1,max(X)) + xlim(min(X)-0.1,30) + plt.step(X, Y,'.r-',label='TP-T', linewidth = 3.5,markersize=20) #plt.show() b = max(X) #leng = len(Y) #print leng pic.legend(bbox_to_anchor=(0.47, 1), loc=0, borderaxespad=0.,prop={'size':45}) - if time == 16.0: - Real = [58.0, 59.0, 58.0, 56.0, 58.0, 60.0, 60.0, 59.0, 60.0, 56.0, 58.0, 58.0, 59.0, 61.0, 57.0, 60.0, 59.0, 62.0, 57.0, 62.0, 57.0] - Occtraflwr = [58.920621425008449, 58.291577091475219, 59.32294102666107, 58.518773321619868, 58.87247933148354, 58.836231372682484, 59.179407677396966, 58.899737397766756, 58.920695547726083, 58.597767224241245, 59.04375628032745, 58.75574316360138, 59.622693078707535, 58.652352255611049, 58.909935842210096, 58.828047158709246, 59.094413053126431, 59.38699857527974, 58.998641045169713, 58.198583478889596, 59.538340558365007] + if time == 19.0: + #Real = [59.0, 58.0, 59.0, 60.0, 59.0, 60.0, 56.0, 60.0, 62.0, 59.0, 60.0, 62.0, 62.0, 58.0, 62.0, 59.0, 62.0, 59.0, 60.0, 56.0, 58.0] + #Occlwr = [59.228085002760288, 59.094069442683448, 59.38853420959591, 59.97813944490975, 58.260686351578194, 58.300288958066879, 58.19193951035934, 58.20970569260222, 57.893899005531807, 58.170879420292657, 57.945424917571017, 57.673863709660623, 57.861536830764528, 58.001963891056668, 57.783551871005372, 58.065421153569027, 57.78562450192117, 57.550921828002018, 58.082562904649023, 58.151306938099061, 57.739278250990509] + Real = [58.0, 59.0, 56.0, 62.0, 56.0, 59.0, 59.0, 58.0, 58.0, 62.0, 58.0, 59.0, 59.0, 57.0, 59.0, 60.0, 59.0, 58.0, 59.0, 60.0, 61.0, 57.0, 58.0, 56.0, 57.0, 59.0, 58.0, 60.0, 60.0, 58.0, 58.0, 59.0, 58.0, 61.0, 57.0, 59.0, 57.0, 59.0, 59.0, 59.0, 62.0, 59.0, 58.0, 59.0, 60.0, 59.0, 60.0, 56.0, 60.0, 62.0, 59.0, 60.0, 62.0, 62.0, 58.0, 62.0, 59.0, 62.0, 59.0, 60.0, 56.0, 58.0] + Occlwr = [59.227780543275564, 59.924176897156606, 59.578110078635696, 59.275252774175691, 58.769510213305523, 60.094983125658992, 59.377486126409792, 60.589310315966046, 59.72580392210029, 59.344985471311411, 59.242752557028702, 59.47443851033286, 59.344819922526852, 59.652188948111657, 59.586918202659341, 59.454114085230671, 61.549791163698849, 60.170568033161537, 60.209623894738883, 60.451774380170313, 60.404841611291936, 60.141581294664135, 60.002591200360783, 60.320517910637463, 60.191625601002542, 60.663202822305621, 60.473084418456537, 59.870895330849265, 60.293808254426054, 60.61975555229548, 60.524777806006469, 59.98705985359171, 60.3623134095889, 60.29442962464698, 60.704622565759195, 60.0492517043375, 60.146507176011674, 60.358203576157244, 61.03703612746552, 60.408509227406448, 60.240906581236828, 60.536970877071568, 60.323846270429918, 59.644046591435917, 59.488250710770139, 60.124113585153623, 60.326370979050147, 60.048207358097677, 60.748532133526965, 60.703440933755665, 60.643284238124117, 60.716149516909603, 60.36957240181286, 60.552775838814092, 60.378302385877362, 60.954280096443945, 60.333932297784969, 60.584974166142722, 60.522772410579634, 60.674969985095686, 60.247854018859094, 60.40836327859801] elif time == 17.0: - Real = [59.0, 59.0, 59.0, 60.0, 56.0, 59.0, 59.0, 59.0, 59.0, 59.0, 60.0, 59.0, 60.0, 59.0, 59.0, 62.0, 58.0, 58.0, 59.0, 57.0, 58.0] - Occtraflwr = [58.819110907218089, 58.754440850740252, 58.707566598243211, 58.691671314068877, 58.758768758296462, 58.693374206687253, 58.79395041937714, 58.825970794828692, 58.799346076728348, 58.705427701363377, 58.665535340936685, 58.866990631146201, 58.773317862360578, 58.799104491440758, 58.842071482687309, 58.777559913611604, 58.804107070134286, 58.889079660011667, 58.738712233540099, 58.77692611422853, 58.744114787827947] + #Real = [59.0, 59.0, 59.0, 60.0, 56.0, 59.0, 59.0, 59.0, 59.0, 59.0, 60.0, 59.0, 60.0, 59.0, 59.0, 62.0, 58.0, 58.0, 59.0, 57.0, 58.0] + #Occlwr = [58.857216955487154, 58.857097391956202, 58.857092900762709, 58.857148285401273, 58.857271938715215, 58.857009630910305, 58.857328701522938, 58.857208820699242, 58.857076397208509, 58.857311090749775, 58.85723159789579, 58.857567834018489, 58.857425964079084, 58.857285475707634, 58.857516494997228, 58.857482137116484, 58.857526844117473, 58.857433327552037, 58.857319473188369, 58.857307600931456, 58.857373663813377] + Real = [59.0, 59.0, 57.0, 62.0, 59.0, 59.0, 59.0, 60.0, 60.0, 59.0, 59.0, 59.0, 59.0, 59.0, 57.0, 60.0, 58.0, 57.0, 56.0, 59.0, 59.0, 59.0, 60.0, 59.0, 59.0, 61.0, 58.0, 59.0, 59.0, 59.0, 59.0, 59.0, 58.0, 59.0, 56.0, 59.0, 57.0, 59.0, 59.0, 59.0, 60.0, 59.0, 59.0, 59.0, 60.0, 56.0, 59.0, 59.0, 59.0, 59.0, 59.0, 60.0, 59.0, 60.0, 59.0, 59.0, 62.0, 58.0, 58.0, 59.0, 57.0, 58.0] + Occlwr = [58.894235764500088, 58.69212190383373, 58.668196243734293, 58.623137385207102, 58.516331298441855, 58.63644283957197, 58.872094748272623, 59.112462193565001, 57.898429309341594, 58.687397990655192, 58.560024129594325, 58.676518463125404, 58.572502252946997, 58.589483537555282, 58.590060132899808, 58.633747435191047, 58.335636060791828, 58.765608234740533, 58.972515998209779, 59.080033410964603, 58.845635020182485, 58.955891700040588, 58.771038859950693, 58.774545470560689, 58.797578911016856, 58.87145130774573, 58.766910784625793, 58.749870227070872, 58.949224278408209, 59.039976199931552, 58.655481006964266, 58.8532961293364, 59.376247083160003, 58.832883733819209, 58.64110600066315, 58.948804627296305, 58.875368967973635, 58.735866801350014, 58.890416501647842, 58.878715884155312, 58.897017317845155, 58.731282473711978, 58.894800119681385, 59.048606140456123, 58.76040763945322, 58.854259444267157, 58.906691461087156, 59.105244360675044, 59.145442309247663, 58.851574919337608, 59.008736349072421, 58.935858581499133, 58.890058076161765, 58.796429921498131, 59.053300308254798, 59.240033637472415, 59.040137846728769, 58.741725108034139, 58.999724089951918, 58.850429584818173, 58.893626915358709, 58.931424067518293] + elif time == 20.0: + Real = [62.0, 59.0, 62.0, 58.0, 59.0, 60.0, 60.0, 61.0, 58.0, 56.0, 60.0, 59.0, 58.0, 62.0, 60.0, 59.0, 60.0, 59.0, 56.0, 62.0, 56.0] + Occlwr = [59.429282575434939, 59.382571494913584, 59.330274832261587, 59.28235656329035, 59.017454812409078, 59.127509579600265, 59.008075984387332, 58.943565191212862, 58.802070410325555, 58.95216471492688, 59.00535840552871, 58.669444873041215, 58.845181397003884, 58.717786909985186, 58.796368017256583, 59.1035962541036, 58.951571723183669, 58.93716939139675, 58.950377435733458, 58.845205052341264, 58.852435278093516] elif time == 18.0: Real = [58.0, 60.0, 59.0, 59.0, 58.0, 59.0, 58.0, 62.0, 58.0, 59.0, 59.0, 60.0, 56.0, 57.0, 59.0, 57.0, 59.0, 56.0, 59.0, 59.0, 56.0] - Occtraflwr = [58.447769637707772, 58.366154904081149, 58.730416828547575, 59.024014142002422, 58.22982464557392, 58.640574644085966, 58.764229639154081, 58.719729935365841, 58.670967537145501, 58.864195872538637, 58.806820474500697, 58.592547678126081, 58.938344633399268, 58.527407224811228, 58.63196901393249, 59.011548917637107, 58.606296098351109, 58.582475829969361, 58.671356274513172, 58.454252929307778, 58.627615925678036] - elif time == 19.0: - Real = [59.0, 58.0, 59.0, 60.0, 59.0, 60.0, 56.0, 60.0, 62.0, 59.0, 60.0, 62.0, 62.0, 58.0, 62.0, 59.0, 62.0, 59.0, 60.0, 56.0, 58.0] - Occtraflwr = [58.555037814836311, 58.936393832203365, 58.589226966559629, 58.155545770382076, 58.205453236714149, 58.448309518584907, 58.25920046722954, 59.497570305311072, 58.440651250943446, 58.762359530958292, 58.99015307298825, 58.438368231684436, 58.512435664946288, 58.419270420991495, 58.496861544770965, 58.177733088116561, 58.476850541288108, 58.228870517925472, 58.424488254722625, 58.387422167887898, 58.409390453609454] - elif time == 20.5: - Real = [58.0, 60.0, 59.0, 59.0, 59.0, 59.0, 58.0, 57.0, 59.0, 59.0, 58.0, 58.0, 57.0, 62.0, 62.0, 62.0, 59.0, 59.0, 58.0, 59.0, 59.0] - Occtraflwr = [58.889618169823564, 58.420855476570232, 58.215523282400596, 58.106694214154224, 58.332925595911426, 58.189297893611069, 58.365262976457707, 58.597107290226035, 58.41166517580907, 58.29045799921834, 58.522614384064603, 58.330896564285659, 58.15962756501817, 58.444565820038505, 58.670679927855645, 58.466677832171946, 58.376497338584954, 58.377036778214858, 58.373019002788361, 58.097996223511366, 58.689049616530397] + Occlwr = [57.974903990235276, 59.313686949756338, 59.042842517656794, 59.030825848988719, 57.895499847288448, 58.468600324564846, 58.667218396378424, 58.699564675518737, 57.886131370242389, 58.98029950379771, 58.403788063094709, 57.440817964341498, 58.147095013987837, 57.434060496315404, 58.71920443881622, 58.401837892532043, 58.562934404883372, 58.328064094081007, 58.35028761102074, 58.184386179235815, 58.252856747597839] elif time == 21.0: - Real = [67.0, 62.0, 62.0, 63.0, 63.0, 64.0, 63.0, 63.0, 67.0, 62.0, 63.0, 63.0, 67.0, 63.0, 63.0, 61.0, 63.0, 62.0, 63.0, 63.0, 64.0] - Occtraflwr = [63.134976389584118, 63.405328773536496, 63.022932289179764, 63.593816507071921, 63.417241302998001, 63.257910052549406, 63.243446343930202, 63.246259625203187, 63.654006493057437, 63.946756160407944, 63.318866368035124, 63.423860203386802, 63.809153147762842, 63.225209091880565, 63.267845375124267, 63.511181376241602, 63.368189494434674, 63.432380588569039, 63.942082646980836, 63.046744689149229, 63.786257085620562] - elif time == 20.0: - Real = [62.0, 59.0, 62.0, 58.0, 59.0, 60.0, 60.0, 61.0, 58.0, 56.0, 60.0, 59.0, 58.0, 62.0, 60.0, 59.0, 60.0, 59.0, 56.0, 62.0, 56.0] - Occtraflwr = [59.294513999253304, 58.931649923731186, 59.530798058866878, 58.648758165487834, 59.570298718257916, 59.063033574754179, 58.900275122566747, 59.602183385946823, 59.46573645982707, 59.658626071221853, 59.793530881061216, 60.245556545510354, 59.492015063326981, 59.044903637092091, 59.796526927502718, 58.613187952693359, 59.627741116562298, 58.473638844341963, 59.954545371782764, 58.117813390860881, 60.082419453326885] + #Real = [67.0, 62.0, 62.0, 63.0, 63.0, 64.0, 63.0, 63.0, 67.0, 62.0, 63.0, 63.0, 67.0, 63.0, 63.0, 61.0, 63.0, 62.0, 63.0, 63.0, 64.0] + #Occlwr = [64.036451631789618, 64.009926977242003, 64.014921289345452, 63.97658355339432, 63.998058992942354, 63.874142845261908, 64.026921282202579, 63.94747406702475, 64.018169099547634, 64.034789456935272, 64.064583992810086, 64.028526851809232, 64.023166906673978, 64.11046642200246, 64.039860323248703, 64.020151767239497, 64.080874508225435, 64.009579519725492, 64.035839358094947, 64.070946753162019, 64.089342573556863] + Real = [63.0, 63.0, 63.0, 63.0, 66.0, 63.0, 66.0, 63.0, 64.0, 63.0, 64.0, 63.0, 63.0, 63.0, 65.0, 63.0, 64.0, 60.0, 63.0, 60.0, 63.0, 64.0, 63.0, 63.0, 63.0, 63.0, 67.0, 63.0, 63.0, 67.0, 65.0, 65.0, 63.0, 63.0, 65.0, 63.0, 63.0, 64.0, 65.0, 63.0, 64.0, 67.0, 62.0, 62.0, 63.0, 63.0, 64.0, 63.0, 63.0, 67.0, 62.0, 63.0, 63.0, 67.0, 63.0, 63.0, 61.0, 63.0, 62.0, 63.0, 63.0, 64.0] + Occlwr = [63.182843714167312, 63.291564115774499, 63.02119315741475, 63.444070059258237, 63.409491934898973, 62.938978575296161, 63.054632132962958, 63.498773677017766, 63.761442546591397, 64.563061990259499, 65.178303884040147, 64.28185568006883, 64.687081699565226, 65.763712675929852, 63.904056979367965, 63.953502586049751, 63.304897366442106, 63.511784255387596, 63.398813483859733, 63.751524432206843, 63.297854545494047, 63.359926798777344, 63.22945570242198, 63.319826598103461, 63.085413799446229, 62.961574710166261, 62.937746129824326, 62.901206123522542, 63.366845252569483, 62.945002121839686, 62.641166567348549, 63.170139082123171, 62.875248507159327, 63.051116644658286, 62.811336718002551, 63.051158196482021, 62.564585421431353, 63.130661418612519, 62.73152952789782, 62.793937732934928, 63.12439406964652, 63.508483831112549, 63.653337940364032, 63.129189453738682, 62.692150874795551, 62.872051489115066, 62.423759089902234, 62.863221030346516, 63.102560119922281, 62.985142567984788, 62.519538960189813, 62.872274057821031, 62.745435587960891, 62.903478456835245, 62.765115909925612, 62.74101868885387, 62.793249516280852, 62.771755790699217, 62.609327935107139, 63.079398757255994, 63.157695524578678, 63.266705622562732] elif time == 22.0: Real = [66.0, 65.0, 66.0, 70.0, 66.0, 63.0, 66.0, 68.0, 64.0, 65.0, 66.0, 65.0, 66.0, 66.0, 64.0, 70.0, 65.0, 66.0, 66.0, 65.0, 66.0] - Occtraflwr = [66.068646487838649, 65.231697872899204, 65.579095187064297, 65.907918320189907, 64.980206231479869, 65.976068175288148, 65.913910513310185, 65.968362816357427, 66.385849920371854, 66.023987873361406, 66.097527474567997, 65.828888852474435, 66.489018871206639, 66.066683243151715, 65.895392456622233, 65.676364698229733, 66.154104847306158, 66.381244066382976, 65.869619618572713, 65.882249675567593, 66.041606632709986] - elif time == 21.5: - Real = [62.0, 65.0, 65.0, 64.0, 65.0, 70.0, 65.0, 62.0, 65.0, 65.0, 66.0, 69.0, 66.0, 66.0, 62.0, 67.0, 66.0, 65.0, 66.0, 67.0, 66.0] - Occtraflwr = [64.637061879563277, 64.827712685964158, 64.660673757850205, 64.389170908673634, 64.974209990210497, 64.4106996949006, 65.178985804820726, 65.325190866464311, 64.697744387975817, 64.717490058644714, 65.61990544475114, 64.988643707129029, 65.231116605223121, 64.169343671591207, 64.76600264534575, 63.428361153439241, 65.052724273938793, 64.829028984969554, 65.105322650179431, 64.222671695835018, 65.40427324002367] - print mean_squared_error(Real, Occtraflwr) + Occlwr = [67.744419179802222, 66.290201457531211, 67.082632005715027, 64.759155036595814, 64.526196619043816, 65.782943852570043, 65.684911932533552, 65.094627786467271, 63.889034043192886, 64.535707675397944, 64.911476687761834, 64.029079184927923, 64.673697914079909, 64.125917781049949, 63.902024524594708, 64.442017163590506, 64.300437780333766, 65.204559660828693, 65.067125561960111, 65.22547733822752, 63.69088489022775] + + print mean_squared_error(Real, Occlwr) mse = [] - for i in range(20): + for i in range(40): mse.append(0) MSE = [] cnt = 0 for i in range(len(Real)): - temp = int(np.ceil((Occtraflwr[i] - Real[i])*(Occtraflwr[i] - Real[i]))) + temp = int(np.ceil((Occlwr[i] - Real[i])*(Occlwr[i] - Real[i]))) + print temp mse[temp] += 1 cnt += 1 MSE.append(temp) @@ -1123,16 +2094,15 @@ def AutoLocatorInit(self): #print X #print len(Y) ylim(min(Y),max(Y)+0.01) - #xlim(min(X)-0.1,max(X)) + ax=plt.gca() - ax.set_xticks(np.linspace(0,15,11)) - ax.set_xticklabels( ('0', '1.5', '3', '4.5', '6', '7.5', '9', '10.5', '12', '13.5', '15')) + ax.set_xticks(np.linspace(0,30,11)) + ax.set_xticklabels( ('0', '3', '6', '9', '12', '15', '18', '21','24','27','30')) ax.set_yticks(np.linspace(0,1,9)) ax.set_yticklabels( ('0.00', '0.125', '0.25', '0.375', '0.50','0.625','0.75','0.875','1.0')) - pic.set_xlabel('Squared Error',size=45) pic.set_ylabel('Percentile',size=45) - plt.step(X, Y, 'k-',label='TFO-P', linewidth=3.5) + plt.step(X, Y, 'k-',label='TPO-T', linewidth=3.5) pic.legend(bbox_to_anchor=(0.95, 0.3), loc=0, borderaxespad=0.,prop={'size':45}) a = np.linspace(max(X),b) @@ -1143,289 +2113,158 @@ def AutoLocatorInit(self): c=[] for aa in range(len(a)): c.append(1) - pic.plot(a,c,'k-',linewidth=3.5) - - + pic.plot(a,c,'k-',linewidth=3.5) + plt.grid(True, linewidth = 3) plt.show() -#elif graph == 30: #cdf of TFO-TT and TF-T -# import numpy as np -# from sklearn.metrics import mean_squared_error -# import matplotlib.pyplot as plt -# import statsmodels.api as sm # recommended import according to the docs -# -# pic = plt.subplot(1,1,1) -# plt.rcParams['xtick.labelsize'] = 40 -# plt.rcParams['ytick.labelsize'] = 40 -# plt.rcParams['axes.labelsize'] = 50 -# -# time = 18 -# if time == 19.0: -# Real = [69.0, 69.0, 58.0, 59.0, 56.0, 62.0, 59.0, 69.0, 56.0, 59.0, 59.0, 58.0, 58.0, 58.0, 69.0, 62.0, 58.0, 59.0, 59.0, 57.0, 57.0, 65.0, 59.0, 60.0, 59.0, 58.0, 59.0, 59.0, 61.0, 60.0, 69.0, 61.0, 57.0, 58.0, 58.0, 69.0, 56.0, 57.0, 59.0, 58.0, 60.0, 59.0, 64.0, 60.0, 58.0, 58.0, 59.0, 58.0, 60.0, 67.0, 61.0, 57.0, 59.0, 57.0, 59.0, 59.0, 62.0, 59.0, 59.0, 62.0, 59.0, 61.0, 67.0, 58.0, 59.0, 60.0, 59.0, 60.0, 56.0, 69.0, 56.0, 60.0, 62.0, 59.0, 60.0, 59.0, 66.0, 62.0, 62.0, 58.0, 62.0, 59.0, 58.0, 69.0, 62.0, 59.0, 60.0, 56.0, 58.0, 60.0] -# Ha = [59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5, 59.5] -# elif time == 17.0: -# Real = [66.0, 71.0, 59.0, 59.0, 57.0, 62.0, 56.0, 71.0, 59.0, 59.0, 59.0, 60.0, 60.0, 57.0, 68.0, 59.0, 59.0, 59.0, 59.0, 59.0, 62.0, 66.0, 57.0, 60.0, 58.0, 57.0, 56.0, 56.0, 70.0, 59.0, 66.0, 59.0, 59.0, 60.0, 56.0, 64.0, 59.0, 59.0, 61.0, 58.0, 59.0, 56.0, 67.0, 59.0, 59.0, 59.0, 59.0, 58.0, 62.0, 67.0, 59.0, 56.0, 59.0, 57.0, 59.0, 62.0, 65.0, 59.0, 59.0, 60.0, 59.0, 58.0, 67.0, 59.0, 59.0, 60.0, 56.0, 59.0, 56.0, 68.0, 59.0, 59.0, 59.0, 59.0, 60.0, 56.0, 67.0, 59.0, 60.0, 59.0, 59.0, 62.0, 56.0, 67.0, 58.0, 58.0, 59.0, 57.0, 58.0, 56.0] -# Ha = [59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308, 59.57692307692308] -# elif time == 18.0: -# Real = [58.0, 56.0, 64.0, 60.0, 59.0, 59.0, 58.0, 59.0, 60.0, 64.0, 58.0, 62.0, 58.0, 59.0, 59.0, 61.0, 62.0, 60.0, 56.0, 57.0, 59.0, 57.0, 59.0, 66.0, 59.0, 56.0, 59.0, 59.0, 56.0, 58.0] -# Ha = [59.333333333333336, 59.333333333333336, 59.333333333333336, 59.333333333333336, 59.333333333333336, 59.333333333333336, 59.333333333333336, 59.333333333333336, 59.333333333333336, 59.333333333333336, 59.333333333333336, 59.333333333333336, 59.333333333333336, 59.333333333333336, 59.333333333333336, 59.333333333333336, 59.333333333333336, 59.333333333333336, 59.333333333333336, 59.333333333333336, 59.333333333333336, 59.333333333333336, 59.333333333333336, 59.333333333333336, 59.333333333333336, 59.333333333333336, 59.333333333333336, 59.333333333333336, 59.333333333333336, 59.333333333333336] -# elif time == 20.0: -# Real = [62.0, 56.0, 63.0, 59.0, 62.0, 58.0, 59.0, 60.0, 59.0, 64.0, 60.0, 61.0, 58.0, 56.0, 60.0, 59.0, 65.0, 59.0, 58.0, 62.0, 60.0, 59.0, 56.0, 64.0, 60.0, 59.0, 56.0, 62.0, 56.0, 59.0] -# Ha = [60.0, 60.0, 60.0, 60.0, 60.0, 60.0, 60.0, 60.0, 60.0, 60.0, 60.0, 60.0, 60.0, 60.0, 60.0, 60.0, 60.0, 60.0, 60.0, 60.0, 60.0, 60.0, 60.0, 60.0, 60.0, 60.0, 60.0, 60.0, 60.0, 60.0] -# elif time == 21.0: -# Real = [67.0, 67.0, 63.0, 63.0, 63.0, 63.0, 73.0, 67.0, 66.0, 63.0, 66.0, 63.0, 64.0, 73.0, 67.0, 63.0, 64.0, 63.0, 63.0, 63.0, 73.0, 67.0, 65.0, 63.0, 64.0, 60.0, 63.0, 72.0, 67.0, 60.0, 67.0, 63.0, 64.0, 63.0, 73.0, 67.0, 63.0, 63.0, 63.0, 67.0, 63.0, 69.0, 67.0, 63.0, 67.0, 65.0, 65.0, 63.0, 70.0, 67.0, 63.0, 65.0, 63.0, 63.0, 64.0, 73.0, 71.0, 65.0, 63.0, 64.0, 67.0, 65.0, 67.0, 62.0, 62.0, 63.0, 63.0, 64.0, 67.0, 68.0, 63.0, 63.0, 67.0, 62.0, 63.0, 70.0, 67.0, 63.0, 67.0, 63.0, 63.0, 61.0, 71.0, 67.0, 63.0, 62.0, 63.0, 63.0, 64.0, 73.0] -# Ha = [64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307, 64.807692307692307] -# elif time == 22.0: -# Real = [66.0, 69.0, 66.0, 65.0, 66.0, 70.0, 66.0, 63.0, 65.0, 68.0, 66.0, 68.0, 64.0, 65.0, 66.0, 66.0, 69.0, 65.0, 66.0, 66.0, 64.0, 70.0, 69.0, 70.0, 65.0, 66.0, 66.0, 65.0, 66.0, 69.0] -# Ha = [66.700000000000003, 66.700000000000003, 66.700000000000003, 66.700000000000003, 66.700000000000003, 66.700000000000003, 66.700000000000003, 66.700000000000003, 66.700000000000003, 66.700000000000003, 66.700000000000003, 66.700000000000003, 66.700000000000003, 66.700000000000003, 66.700000000000003, 66.700000000000003, 66.700000000000003, 66.700000000000003, 66.700000000000003, 66.700000000000003, 66.700000000000003, 66.700000000000003, 66.700000000000003, 66.700000000000003, 66.700000000000003, 66.700000000000003, 66.700000000000003, 66.700000000000003, 66.700000000000003, 66.700000000000003] -# -# print mean_squared_error(Real, Ha) -# mse = [] -# for i in range(135): -# mse.append(0) -# MSE = [] -# cnt = 0 -# for i in range(len(Real)): -# temp = int(np.ceil((Ha[i] - Real[i])*(Ha[i] - Real[i]))) -# print temp -# mse[temp] += 1 -# cnt += 1 -# MSE.append(temp) -# -# print mse -# ecdf = sm.distributions.ECDF(MSE) -# x = np.linspace(min(MSE), max(MSE)) -# y = ecdf(x) -# #print x -# #print y -# -# X = [] -# Y = [] -# X.append(0.1) -# Y.append(0) -# for xx in x: -# X.append(xx) -# for yy in y: -# Y.append(yy) -# X.append(x[-1]) -# Y.append(y[-1]) -# #print X -# #print Y -# #ylim(min(Y),max(Y)+0.01) -# #xlim(min(X)-0.1,max(X)) -# xlim(min(X)-0.1,15) -# plt.step(X, Y,'.r-',label='TF-T', linewidth = 3.5,markersize=20) -# #plt.show() -# b = max(X) -# #leng = len(Y) -# #print leng -# pic.legend(bbox_to_anchor=(0.47, 1), loc=0, borderaxespad=0.,prop={'size':45}) -# -# if time == 19.0: -# Real = [59.0, 58.0, 59.0, 60.0, 59.0, 60.0, 56.0, 60.0, 62.0, 59.0, 60.0, 62.0, 62.0, 58.0, 62.0, 59.0, 62.0, 59.0, 60.0, 56.0, 58.0] -# Occlwr = [59.228085002760288, 59.094069442683448, 59.38853420959591, 59.97813944490975, 58.260686351578194, 58.300288958066879, 58.19193951035934, 58.20970569260222, 57.893899005531807, 58.170879420292657, 57.945424917571017, 57.673863709660623, 57.861536830764528, 58.001963891056668, 57.783551871005372, 58.065421153569027, 57.78562450192117, 57.550921828002018, 58.082562904649023, 58.151306938099061, 57.739278250990509] -# elif time == 17.0: -# Real = [59.0, 59.0, 59.0, 60.0, 56.0, 59.0, 59.0, 59.0, 59.0, 59.0, 60.0, 59.0, 60.0, 59.0, 59.0, 62.0, 58.0, 58.0, 59.0, 57.0, 58.0] -# Occlwr = [58.857216955487154, 58.857097391956202, 58.857092900762709, 58.857148285401273, 58.857271938715215, 58.857009630910305, 58.857328701522938, 58.857208820699242, 58.857076397208509, 58.857311090749775, 58.85723159789579, 58.857567834018489, 58.857425964079084, 58.857285475707634, 58.857516494997228, 58.857482137116484, 58.857526844117473, 58.857433327552037, 58.857319473188369, 58.857307600931456, 58.857373663813377] -# elif time == 20.0: -# Real = [62.0, 59.0, 62.0, 58.0, 59.0, 60.0, 60.0, 61.0, 58.0, 56.0, 60.0, 59.0, 58.0, 62.0, 60.0, 59.0, 60.0, 59.0, 56.0, 62.0, 56.0] -# Occlwr = [59.429282575434939, 59.382571494913584, 59.330274832261587, 59.28235656329035, 59.017454812409078, 59.127509579600265, 59.008075984387332, 58.943565191212862, 58.802070410325555, 58.95216471492688, 59.00535840552871, 58.669444873041215, 58.845181397003884, 58.717786909985186, 58.796368017256583, 59.1035962541036, 58.951571723183669, 58.93716939139675, 58.950377435733458, 58.845205052341264, 58.852435278093516] -# elif time == 18.0: -# Real = [58.0, 60.0, 59.0, 59.0, 58.0, 59.0, 58.0, 62.0, 58.0, 59.0, 59.0, 60.0, 56.0, 57.0, 59.0, 57.0, 59.0, 56.0, 59.0, 59.0, 56.0] -# Occlwr = [57.974903990235276, 59.313686949756338, 59.042842517656794, 59.030825848988719, 57.895499847288448, 58.468600324564846, 58.667218396378424, 58.699564675518737, 57.886131370242389, 58.98029950379771, 58.403788063094709, 57.440817964341498, 58.147095013987837, 57.434060496315404, 58.71920443881622, 58.401837892532043, 58.562934404883372, 58.328064094081007, 58.35028761102074, 58.184386179235815, 58.252856747597839] -# elif time == 21.0: -# Real = [67.0, 62.0, 62.0, 63.0, 63.0, 64.0, 63.0, 63.0, 67.0, 62.0, 63.0, 63.0, 67.0, 63.0, 63.0, 61.0, 63.0, 62.0, 63.0, 63.0, 64.0] -# Occlwr = [64.036451631789618, 64.009926977242003, 64.014921289345452, 63.97658355339432, 63.998058992942354, 63.874142845261908, 64.026921282202579, 63.94747406702475, 64.018169099547634, 64.034789456935272, 64.064583992810086, 64.028526851809232, 64.023166906673978, 64.11046642200246, 64.039860323248703, 64.020151767239497, 64.080874508225435, 64.009579519725492, 64.035839358094947, 64.070946753162019, 64.089342573556863] -# elif time == 22.0: -# Real = [66.0, 65.0, 66.0, 70.0, 66.0, 63.0, 66.0, 68.0, 64.0, 65.0, 66.0, 65.0, 66.0, 66.0, 64.0, 70.0, 65.0, 66.0, 66.0, 65.0, 66.0] -# Occlwr = [67.744419179802222, 66.290201457531211, 67.082632005715027, 64.759155036595814, 64.526196619043816, 65.782943852570043, 65.684911932533552, 65.094627786467271, 63.889034043192886, 64.535707675397944, 64.911476687761834, 64.029079184927923, 64.673697914079909, 64.125917781049949, 63.902024524594708, 64.442017163590506, 64.300437780333766, 65.204559660828693, 65.067125561960111, 65.22547733822752, 63.69088489022775] -# -# print mean_squared_error(Real, Occlwr) -# -# mse = [] -# for i in range(40): -# mse.append(0) -# MSE = [] -# cnt = 0 -# for i in range(len(Real)): -# temp = int(np.ceil((Occlwr[i] - Real[i])*(Occlwr[i] - Real[i]))) -# print temp -# mse[temp] += 1 -# cnt += 1 -# MSE.append(temp) -# #print mse -# ecdf = sm.distributions.ECDF(MSE) -# x = np.linspace(min(MSE), max(MSE)) -# y = ecdf(x) -# #print x -# #print y -# -# -# X = [] -# Y = [] -# X.append(0.1) -# Y.append(0) -# for xx in x: -# X.append(xx) -# for yy in y: -# Y.append(yy) -# X.append(x[-1]) -# Y.append(y[-1]) -# -# #print X -# #print len(Y) -# ylim(min(Y),max(Y)+0.01) -# -# ax=plt.gca() -# ax.set_xticks(np.linspace(0,15,11)) -# ax.set_xticklabels( ('0', '1.5', '3', '4.5', '6', '7.5', '9', '10.5', '12', '13.5', '15')) -# ax.set_yticks(np.linspace(0,1,9)) -# ax.set_yticklabels( ('0.00', '0.125', '0.25', '0.375', '0.50','0.625','0.75','0.875','1.0')) -# pic.set_xlabel('Squared Error',size=45) -# pic.set_ylabel('Percentile',size=45) -# plt.step(X, Y, 'k-',label='TFO-TT', linewidth=3.5) -# pic.legend(bbox_to_anchor=(0.95, 0.3), loc=0, borderaxespad=0.,prop={'size':45}) -# -# a = np.linspace(max(X),b) -# c=[] -# for aa in range(len(a)): -# c.append(1) -# a = np.linspace(max(X),b) -# c=[] -# for aa in range(len(a)): -# c.append(1) -# pic.plot(a,c,'k-',linewidth=3.5) -# -# plt.show() -elif graph == 31:#weight of O vs T: 150-240 - time1 =[ 15.0 , 15.1 , 15.2 , 15.3 , 15.4 , 15.5 , 15.6 , 15.7 , 15.8 , 15.9 , 16.0 , 16.1 , 16.2 , 16.3 , 16.4 , 16.5 , 16.6 , 16.7 , 16.8 , 16.9 , 17.0 , 17.1 , 17.2 , 17.3 , 17.4 , 17.5 , 17.6 , 17.7 , 17.8 , 17.9 , 18.0 , 18.1, 18.2 , 18.3 , 18.4 , 18.5 , 18.6 , 18.7 , 18.8 , 18.9 , 19.0 , 19.1 , 19.2 , 19.3 , 19.4 , 19.5 , 19.6 , 19.7 , 19.8 , 19.9 , 20.0 , 20.1 , 20.2 , 20.3 , 20.4 , 20.5 , 20.6 , 20.7 , 20.8 , 20.9, 21.0 , 21.1 , 21.2 , 21.3 , 21.4 , 21.5 , 21.6 , 21.7 , 21.8 , 21.9 , 22.0 , 22.1 , 22.2 , 22.3 , 22.4 , 22.5 , 22.6 , 22.7 , 22.8 , 22.9 , 23.0 , 23.1 , 23.2 , 23.3 , 23.4 , 23.5 , 23.6 , 23.7 , 23.8, 23.9 , 24.0] - #traf2 = [5.648282572 , 5.15543392949 , 5.23828111858 , 3.99522995564 , 6.40135656351 , 3.33011698012 , 3.42595792088 , 0.887920546277 , 4.9063025046 , 6.3892931963 , 4.77314847668 , 3.43746839542 , 5.67484375709 , 5.3297812159 , 4.30606192381 , 4.88982691265 , 2.7806659404 , 2.42147134238 , 1.56921401765 , 2.26569041117 , 2.05704237866 , 3.68825624997 , 2.62980613877 , 2.08601428096 , 2.15463120912 , 2.12097583292 , 4.0181020104 , 4.76136547779 , 1.51607823457 , 1.75588636357 , 3.67988553676 , 4.16254546425 , 3.89581340977 , 3.16968429168 , 4.3081855229 , 2.12780904865 , 1.02279538146 , 2.07169198145 , 3.7928610568 , 5.00395450386 , 4.65880327762 , 5.13929330473 , 3.66703817684 , 5.6542576756 , 6.3448215367 , 1.10267510654 , 1.75606711166 , 1.90362678901 , 2.37726986022 , 4.40801447609 , 10.7108819679 , 19.1123797487 , 21.9144168831 , 11.4729174715 , 26.1441100047 , 14.1112663432 , 12.2157467347 , 9.47224430272 , 7.76382406644 , 3.72067391465 , 6.27401352228 , 11.9575959907 , 27.0941596366 , 1.4149245575 , 1.08184704264 , 0.775724340466 , 0.763910275063 , 0.419415884139 , 0.428053058844 , 0.740069330471 , 2.44294731878, 4.57328849058 , 5.80687995343 , 6.95878485269 , 7.72893462061 , 7.02814142419 , 5.05219816438 , 5.44598003157 , 6.13105945609 , 4.38539146046 , 6.26051298642 , 7.82124811496 , 6.47002032166 , 10.1974933772 , 3.6415823182 , 8.26392144517 , 4.41229726097 , 3.56887666101 , 6.36807457898 , 6.53689879115 , 6.50894555372] - #traf1 = [ 3.96618645819 , 4.04497622846 , 3.39075473611 , 4.7234606614 , 4.164909464 , 3.74929904373 , 3.90519374081 , 4.01099285863 , 4.64369992486 , 4.57965918692 , 2.82826888741 , 5.0604905316 , 3.99257536387 , 7.18455151752 , 2.36224254873 , 4.16547682492 , 3.34751996066 , 3.58983560969 , 2.43789160656 , 2.54892943846 , 2.54892943846 , 4.86102740209 , 4.39002674918 , 3.4733625116 , 1.65661314039 , 4.30196947144 , 1.85158868053 , 3.45453815456 , 8.26514748182 , 3.39325035825 , 3.05344100669 , 4.92566172441 , 3.90778176245 , 2.98940013899 , 7.03302763038 , 4.51793391538 , 5.11233797865 , 3.58112845539 , 5.31103060742 , 5.36028896036 , 4.68315982201 , 4.68057920356 , 10.2563604348 , 7.45090549345 , 3.48067021098 , 4.95830331286 , 6.78096463283 , 5.14312042025 , 2.79491732187 , 3.85133045544 , 4.39286091368 , 4.15029338914 , 2.69199038573 , 2.6877504365 , 6.18964671317 , 3.92690164743 , 1.4216195593 , 2.32972493884 , 2.68810883884 , 3.07620211093 , 8.10307709548 , 6.24938041557 , 4.41333952399 , 5.74221501923 , 4.89501154313 , 7.2711287331 , 9.07431829147 , 4.32086457158 , 8.21095270683 , 2.74730418402 , 3.6636698868 , 4.57328849058 , 5.80687995343 , 6.95878485269 , 7.72893462061 , 7.02814142419 , 5.05219816438 , 5.44598003157 , 6.13105945609 , 4.38539146046 , 6.26051298642 , 7.82124811496 , 6.47002032166 , 10.1974933772 , 3.6415823182 , 8.26392144517 , 4.41229726097 , 3.56887666101 , 6.36807457898 , 6.53689879115 , 6.50894555372 ] - #occ2 = [ 3.43376451284 , 2.13581708141 , 4.13807611836 , 2.0743030885 , 2.27616236115 , 1.8607885637 , 3.83699568065 , 1.79999159126 , 2.78347123675 , 2.97150955692 , 3.22515920191 , 3.77469326189 , 2.10891340907 , 3.56228204836 , 2.11759849524 , 2.86155397168 , 2.44420294786 , 2.08136370027 , 1.78131533164 , 1.75831115087 , 1.3581481954 , 1.750114629 , 1.85558526873 , 2.72589476056 , 0.978178657459 , 2.20088259943 , 1.01649730622 , 1.55876494568 , 2.46512850977 , 2.73349348778 , 2.20530283716 , 2.60485116759 , 1.81709347884 , 2.67734032855 , 4.88695604165 , 3.61947500178 , 2.06317604437 , 2.24747339295 , 4.66517200172 , 2.72909921161 , 4.07424859228 , 2.52072001884 , 2.45789059095 , 3.45650152966 , 3.28383640492 , 2.54359671034 , 2.56622425956 , 3.67248937226 , 2.2656097676 , 2.9166235183 , 4.2959598894 , 3.41415392555 , 3.10378068753 , 1.59076738622 , 3.32978753887 , 2.10842312598 , 1.97281508282 , 1.53253131361 , 1.0859348115 , 2.29921994879 , 2.84173764276 , 2.95858511647 , 2.55703502614 , 1.55138408102 , 11.8911415216 , 8.31134465283 , 5.12287932888 , 3.34617552468 , 8.79609117735 , 1.71426537655 , 2.92456086528 , 5.30314993131 , 8.23194976761 , 7.19222936391 , 7.20510601604 , 5.99792971854 , 4.32794739852 , 6.46748675904 , 6.80954443842 , 4.91883488077 , 6.31881648107 , 3.31512496675 , 4.79112079617 , 3.16999156393 , 3.54661149475 , 2.75919922857 , 3.98297779129 , 3.89795549457 , 4.02183350182 , 5.68572844005 , 8.03894474887 ] - #occ1 = [ 3.33126992611 , 2.15235043881 , 4.21215375236 , 2.04146402499 , 2.26508236112 , 1.75842743987 , 3.83752010319 , 1.79356812562 , 2.71647871756 , 2.98920028076 , 3.06963761795 , 3.78037524154 , 2.11330949347 , 3.62306600989 , 2.10132375418 , 2.79890211351 , 2.45220911956 , 2.0962944359 , 1.71888897623 , 2.00237892092 , 2.00237892092 , 1.75017286044 , 1.87819485903 , 2.77200592938 , 0.927552735382 , 2.16110258543 , 0.952612535679 , 1.55876494568 , 2.43936505277 , 2.74032154014 , 2.20187230613 , 2.62732676781, 1.81709347884 , 2.68646819361 , 4.87840695719 , 3.58804992604 , 1.96027598281 , 2.16400733578 , 4.55698744552 , 2.61612107743 , 4.1007299461 , 2.60197595024 , 2.42772928849 , 3.70504358394 , 2.64089183244 , 2.53083484208 , 2.69596558723 , 3.82189848477 , 2.10858933652 , 2.69381421149 , 4.48942308279 , 3.48776778082 , 1.75831208948 , 1.48030854681 , 3.2901866737 , 2.33799936521 , 1.50491990853 , 1.23953538087 , 1.19008302381 , 2.36576100342, 2.57888534853 , 2.052794471 , 2.64644323686 , 1.35534774334 , 5.6573022579 , 4.76819909982 , 1.85043233584 , 3.46190356262 , 5.28356384041 , 1.84882416982 , 3.01211103176 , 4.59728665448 , 8.01181670627 , 6.44190774176 , 7.57429158629 , 5.66900034971 , 4.30244931982 , 6.23339404063 , 6.88638460847 , 4.63713969717 , 5.75838213042 , 3.38303474858 , 4.29114582128 , 2.74825804228 , 2.33363923855 , 2.26640425042 , 4.06245325649 , 3.02492973852 , 4.13263598916, 4.06968874886 , 3.87911988994] - - #occ1 = [0.16692424373911482, 0.13704164759839338, 0.31898650830802555, 0.10452958991730418, 0.31734247022119816, 0.32618177540207616, 0.14666069277131949, 0.63816499626480339, 0.20222212595730965, 0.30745867901382179, 0.1081776386963046, 0.1081776386963046, 0.1081776386963046, 0.22744769349924376, 0.064402001317135624, 0.65630934850930966, 0.088356015730331042, 0.11858121691667395, 0.22123896282522026, 0.4172431700232126, 0.1801102608185714, 0.5357994474913671, 0.013358934515704666, 0.013358934515704666, 0.013358934515704666, 0.02928890142675656, 0.19509925496976271, 0.09149841111237525, 0.30475557707556417, 0.020628876229133036, 0.44587333627549025, 0.5169740694897037, 0.086486530428686897, 0.056413050345662519, 0.15005593904338121, 0.15005593904338121, 0.15005593904338121, 0.2178692432394603, 0.34006246238669746, 0.023801051120011213, 0.065710586334031817, 0.26957231375524304, 0.51680640464147753, 0.2108334053111165, 0.025596163398236449, 0.18088277051619972, 0.53369889128197556, 0.53369889128197556, 0.53369889128197556, 0.068350804189212966, 0.20490601178358731, 0.28010519103879217, 0.24792351261265427, 0.19471886019123119, 0.18949320889315055, 0.12231104220748805, 0.59769990043317622, 0.14143533979061235, 0.70597906595178994, 0.70597906595178994, 0.70597906595178994, 0.0612429135423945, 0.43968700066416316, 0.34686503544811798, 0.26026340253064684, 0.13582487867324738, 0.31666970783637693, 0.010776626269295798, 0.22061290038128353, 0.24352653254795392, 0.17772199265846572, 0.17772199265846572, 0.17772199265846572, 0.22171643473378519, 0.15618620512686038, 0.082508952923065398, 1.0318379800925894, 0.41999289642668192, 0.35616611242362006, 0.24795150494878584, 0.71525112321611062, 0.0191633164844968, 0.32286549211754012, 0.32286549211754012, 0.32286549211754012, 0.50552668483042484, 0.44355578395545192, 0.39068423391163876, 0.70745718260287205, 0.24367378831387293, 0.091675917698250925, 0.38021746558744762, 0.82149929593091731, 0.89141246269256569, 0.91078594774446331, 0.91078594774446331, 0.91078594774446331, 0.0045378837697872126, 0.4146017221626761] - #traf1 = [0.091365426892161275, 0.18318562132858984, 0.087518622333160337, 0.12991353273424527, 0.12333303264213957, 0.21871026881445504, 0.18199995502555133, 0.035563566181508924, 0.084652500660990601, 0.19527293859223749, 0.16598578432890765, 0.16598578432890765, 0.16598578432890765, 0.054325340968703444, 0.02209769135073289, 0.11873587140492134, 0.27913688833310613, 0.037738010724058982, 0.17872998077893681, 0.072373732452806039, 0.079229610954410765, 0.14300735540188467, 0.021276381330308951, 0.021276381330308951, 0.021276381330308951, 0.045459755357921211, 0.11834935891563431, 0.024950591197589179, 0.088386111085227814, 0.0035392195651209879, 0.11244785448112346, 0.063855721060757847, 0.074380369122522161, 0.038726148066208006, 0.11042747448848253, 0.11042747448848253, 0.11042747448848253, 0.20369622974738993, 0.15899705454493882, 0.12135197520044982, 0.10682149026144266, 0.25017538992979488, 0.3523298206509583, 0.071337499141292171, 0.015037482916069933, 0.01200362486455929, 0.13674523496742264, 0.13674523496742264, 0.13674523496742264, 0.07515299942694656, 0.26589990386792484, 0.06325581429869033, 0.015009364748792085, 0.14290339384241965, 0.065396055410470194, 0.033389564766905355, 0.014160720212584844, 0.048822701406542518, 0.17155508178326612, 0.17155508178326612, 0.17155508178326612, 0.30015628849540937, 0.016503136256720105, 0.072324402174702651, 0.028525210671920959, 0.1073225638875088, 0.17031121831163859, 0.069389657898292628, 0.029996028462573557, 0.14335754128280118, 0.13293325470109379, 0.13293325470109379, 0.13293325470109379, 0.16423584418805334, 0.060898271438304674, 0.15509548982413313, 0.012893958095829211, 0.24755290976025504, 0.19847282166752547, 0.61390048550958332, 0.23848569783394064, 0.059582229860323244, 0.0942077523412648, 0.0942077523412648, 0.0942077523412648, 0.25805369400602562, 0.16222661710713093, 0.13927239694986465, 0.12208355067051971, 0.38488546753105046, 0.0053375344925239744, 0.040468597148380747, 0.12469703225097389, 0.12481702485875984, 0.22712979159540161, 0.22712979159540161, 0.22712979159540161, 0.23363850137362199, 0.11620911544794008] - occ1 = [0.64626759301346248, 0.42795121120569218, 0.7847047534305015, 0.4458633238419431, 0.72012732307385008, 0.59861724696508289, 0.44623746029358324, 0.94721380662209509, 0.70491464630775935, 0.61157617354145921, 0.39457356310566827, 0.39457356310566827, 0.39457356310566827, 0.80720177475008459, 0.7445344524450388, 0.84680136287007735, 0.2404291749673591, 0.75858369252698776, 0.55314035342748247, 0.85218293713552729, 0.69449506389913751, 0.78932539451232664, 0.38570269071884972, 0.38570269071884972, 0.38570269071884972, 0.39183180924744454, 0.62242819501219693, 0.78573804238205847, 0.77518000825931599, 0.8535581952649145, 0.79859647754236451, 0.89006121569583962, 0.53762788162120001, 0.59295276066383029, 0.57606715532782105, 0.57606715532782105, 0.57606715532782105, 0.5168099789952586, 0.68140662756518666, 0.16397213150392423, 0.38086011384479801, 0.51865994182169817, 0.59462071606506695, 0.74718336293484133, 0.62992533823440056, 0.93776842145417216, 0.79603783579639442, 0.79603783579639442, 0.79603783579639442, 0.47629959950076328, 0.43522395316557061, 0.81577461238932047, 0.94291560302609412, 0.57673585750015022, 0.74343346476699279, 0.78555276427151866, 0.97685629743970193, 0.74338692283733754, 0.80450324101226689, 0.80450324101226689, 0.80450324101226689, 0.16946056658970773, 0.96382399591514567, 0.82746606740654827, 0.90122460038993224, 0.55861117535426397, 0.65027127518363359, 0.13442841190901594, 0.88030742319934374, 0.62945608005173703, 0.57208752843877186, 0.57208752843877186, 0.57208752843877186, 0.57446592970807742, 0.7194720119933401, 0.34725340978094243, 0.98765811819806382, 0.62915966594967832, 0.6421585116581271, 0.28769615629351253, 0.74994600966399605, 0.24335746431401045, 0.77412180332135916, 0.77412180332135916, 0.77412180332135916, 0.662047767126691, 0.73220315277800319, 0.73720038803276822, 0.85282995062970024, 0.38767035255303212, 0.94498150130738756, 0.90380333285775338, 0.86821230590634579, 0.87717634019898882, 0.80039840935220252, 0.80039840935220252, 0.80039840935220252, 0.019052618365397105, 0.78107245140087556] - traf1 = [0.35373240698653746, 0.57204878879430787, 0.21529524656949856, 0.55413667615805684, 0.27987267692614992, 0.40138275303491699, 0.55376253970641676, 0.052786193377904911, 0.29508535369224065, 0.3884238264585409, 0.60542643689433184, 0.60542643689433184, 0.60542643689433184, 0.19279822524991533, 0.25546554755496115, 0.1531986371299226, 0.75957082503264095, 0.24141630747301232, 0.44685964657251748, 0.14781706286447269, 0.30550493610086238, 0.21067460548767336, 0.61429730928115023, 0.61429730928115023, 0.61429730928115023, 0.60816819075255557, 0.37757180498780307, 0.21426195761794159, 0.22481999174068398, 0.14644180473508545, 0.20140352245763554, 0.10993878430416038, 0.46237211837879999, 0.40704723933616982, 0.42393284467217884, 0.42393284467217884, 0.42393284467217884, 0.48319002100474151, 0.31859337243481328, 0.8360278684960758, 0.61913988615520199, 0.48134005817830167, 0.40537928393493305, 0.25281663706515867, 0.3700746617655995, 0.06223157854582774, 0.20396216420360561, 0.20396216420360561, 0.20396216420360561, 0.52370040049923672, 0.56477604683442939, 0.18422538761067958, 0.057084396973905764, 0.42326414249984967, 0.25656653523300721, 0.21444723572848123, 0.023143702560298032, 0.25661307716266246, 0.19549675898773322, 0.19549675898773322, 0.19549675898773322, 0.83053943341029235, 0.036176004084854274, 0.17253393259345168, 0.098775399610067885, 0.44138882464573609, 0.34972872481636647, 0.86557158809098411, 0.11969257680065622, 0.37054391994826297, 0.42791247156122808, 0.42791247156122808, 0.42791247156122808, 0.42553407029192258, 0.28052798800665996, 0.65274659021905757, 0.012341881801936232, 0.37084033405032174, 0.3578414883418729, 0.71230384370648747, 0.25005399033600395, 0.75664253568598949, 0.22587819667864087, 0.22587819667864087, 0.22587819667864087, 0.337952232873309, 0.26779684722199687, 0.26279961196723195, 0.14717004937029973, 0.61232964744696794, 0.055018498692612508, 0.096196667142246589, 0.13178769409365418, 0.12282365980101108, 0.19960159064779756, 0.19960159064779756, 0.19960159064779756, 0.98094738163460282, 0.21892754859912433] - #occ1 = [0.16692424373911482, 0.13704164759839338, 0.31898650830802555, 0.10452958991730418, 0.31734247022119816, 0.32618177540207616, 0.14666069277131949, 0.63816499626480339, 0.20222212595730965, 0.30745867901382179, 0.1081776386963046, 0.1081776386963046, 0.1081776386963046, 0.22744769349924376, 0.064402001317135624, 0.65630934850930966, 0.088356015730331042, 0.11858121691667395, 0.22123896282522026, 0.4172431700232126, 0.1801102608185714, 0.5357994474913671, 0.013358934515704666, 0.013358934515704666, 0.013358934515704666, 0.02928890142675656, 0.19509925496976271, 0.09149841111237525, 0.30475557707556417, 0.020628876229133036, 0.44587333627549025, 0.5169740694897037, 0.086486530428686897, 0.056413050345662519, 0.15005593904338121, 0.15005593904338121, 0.15005593904338121, 0.2178692432394603, 0.34006246238669746, 0.023801051120011213, 0.065710586334031817, 0.26957231375524304, 0.51680640464147753, 0.2108334053111165, 0.025596163398236449, 0.18088277051619972, 0.53369889128197556, 0.53369889128197556, 0.53369889128197556, 0.068350804189212966, 0.20490601178358731, 0.28010519103879217, 0.24792351261265427, 0.19471886019123119, 0.18949320889315055, 0.12231104220748805, 0.59769990043317622, 0.14143533979061235, 0.70597906595178994, 0.70597906595178994, 0.70597906595178994, 0.0612429135423945, 0.43968700066416316, 0.34686503544811798, 0.26026340253064684, 0.13582487867324738, 0.31666970783637693, 0.010776626269295798, 0.22061290038128353, 0.24352653254795392, 0.17772199265846572, 0.17772199265846572, 0.17772199265846572, 0.22171643473378519, 0.15618620512686038, 0.082508952923065398, 1.0318379800925894, 0.41999289642668192, 0.35616611242362006, 0.24795150494878584, 0.71525112321611062, 0.0191633164844968, 0.32286549211754012, 0.32286549211754012, 0.32286549211754012, 0.50552668483042484, 0.44355578395545192, 0.39068423391163876, 0.70745718260287205, 0.24367378831387293, 0.091675917698250925, 0.38021746558744762, 0.82149929593091731, 0.89141246269256569, 0.91078594774446331, 0.91078594774446331, 0.91078594774446331, 0.0045378837697872126, 0.4146017221626761] - #traf1 = [0.83307575626088515, 0.86295835240160668, 0.68101349169197445, 0.89547041008269579, 0.68265752977880179, 0.67381822459792384, 0.85333930722868057, 0.36183500373519661, 0.7977778740426904, 0.69254132098617815, 0.89182236130369541, 0.89182236130369541, 0.89182236130369541, 0.77255230650075624, 0.93559799868286442, 0.34369065149069034, 0.91164398426966897, 0.881418783083326, 0.77876103717477974, 0.58275682997678735, 0.8198897391814286, 0.4642005525086329, 0.98664106548429531, 0.98664106548429531, 0.98664106548429531, 0.97071109857324345, 0.80490074503023723, 0.90850158888762478, 0.69524442292443589, 0.97937112377086699, 0.55412666372450969, 0.4830259305102963, 0.91351346957131307, 0.94358694965433743, 0.84994406095661879, 0.84994406095661879, 0.84994406095661879, 0.78213075676053967, 0.65993753761330254, 0.97619894887998881, 0.93428941366596818, 0.73042768624475696, 0.48319359535852247, 0.7891665946888835, 0.97440383660176355, 0.81911722948380028, 0.46630110871802444, 0.46630110871802444, 0.46630110871802444, 0.93164919581078709, 0.79509398821641275, 0.71989480896120783, 0.75207648738734578, 0.80528113980876881, 0.81050679110684942, 0.87768895779251199, 0.40230009956682378, 0.85856466020938771, 0.29402093404821006, 0.29402093404821006, 0.29402093404821006, 0.93875708645760547, 0.56031299933583689, 0.65313496455188202, 0.73973659746935316, 0.86417512132675256, 0.68333029216362307, 0.98922337373070424, 0.77938709961871644, 0.75647346745204613, 0.82227800734153433, 0.82227800734153433, 0.82227800734153433, 0.77828356526621478, 0.84381379487313968, 0.91749104707693463, -0.031837980092589424, 0.58000710357331808, 0.64383388757637994, 0.75204849505121418, 0.28474887678388938, 0.98083668351550324, 0.67713450788245988, 0.67713450788245988, 0.67713450788245988, 0.49447331516957516, 0.55644421604454808, 0.60931576608836124, 0.29254281739712795, 0.75632621168612713, 0.9083240823017491, 0.61978253441255238, 0.17850070406908269, 0.10858753730743431, 0.089214052255536691, 0.089214052255536691, 0.089214052255536691, 0.99546211623021275, 0.5853982778373239] +elif graph == 32.01:#O versus T - TPO-T TP-T +#TPO-T v.s. TP-T: MSE as a function of time, 20:00-22:00. +# time1 = [ 6.0 , 6.1 , 6.2 , 6.3 , 6.4 , 6.5 , 6.6 , 6.7 , 6.8 , 6.9 , 7.0 , 7.1 , 7.2 , 7.3 , 7.4 , 7.5 , 7.6 , 7.7 , 7.8 , 7.9 , 8.0 , 8.1 , 8.2 , 8.3 , 8.4 , 8.5 , 8.6 , 8.7 , 8.8 , 8.9 , 9.0 , 9.1 , 9.2 , 9.3 , 9.4 , 9.5 , 9.6 , 9.7 , 9.8 , 9.9 , 10.0 , 10.1 , 10.2 , 10.3 , 10.4 , 10.5 , 10.6 , 10.7 , 10.8 , 10.9 , 11.0 , 11.1 , 11.2 , 11.3 , 11.4 , 11.5 , 11.6 , 11.7 , 11.8 , 11.9 , 12.0 , 12.1 , 12.2 , 12.3 , 12.4 , 12.5 , 12.6 , 12.7 , 12.8 , 12.9 , 13.0 , 13.1 , 13.2 , 13.3 , 13.4 , 13.5 , 13.6 , 13.7 , 13.8 , 13.9 , 14.0 , 14.1 , 14.2 , 14.3 , 14.4 , 14.5 , 14.6 , 14.7 , 14.8 , 14.9 , 15.0 , 15.1 , 15.2 , 15.3 , 15.4 , 15.5 , 15.6 , 15.7 , 15.8 , 15.9 , 16.0 , 16.1 , 16.2 , 16.3 , 16.4 , 16.5 , 16.6 , 16.7 , 16.8 , 16.9 , 17.0 , 17.1 , 17.2 , 17.3 , 17.4 , 17.5 , 17.6 , 17.7 , 17.8 , 17.9 , 18.0 , 18.1 , 18.2 , 18.3 , 18.4 , 18.5 , 18.6 , 18.7 , 18.8 , 18.9 , 19.0 , 19.1 , 19.2 , 19.3 , 19.4 , 19.5 , 19.6 , 19.7 , 19.8 , 19.9 , 20.0 , 20.1 , 20.2 , 20.3 , 20.4 , 20.5 , 20.6 , 20.7 , 20.8 , 20.9 , 21.0 , 21.1 , 21.2 , 21.3 , 21.4 , 21.5 , 21.6 , 21.7 , 21.8 , 21.9 , 22.0 ] +# oftt1 = [ 2.24145459457 , 1.73143800808 , 0.799179426583 , 2.01173649785 , 1.81718487406 , 1.15549025585 , 2.81841446511 , 1.31058908497 , 1.10303421876 , 0.645413892646 , 2.58626674665 , 3.61801909886 , 0.952661481413 , 1.33722863725 , 2.33427913521 , 3.25891430085 , 1.58177500317 , 3.16742183238 , 3.40244886268 , 2.74782217877 , 2.02421508291 , 3.43543221065 , 2.75801727099 , 3.47512377666 , 3.21835103328 , 3.55187074828 , 2.58031331124 , 2.29762085226 , 4.06586361021 , 1.99885747247 , 3.50018608759 , 2.89382577221 , 2.87643825366 , 3.82574308484 , 2.88754786537 , 3.4611622107 , 2.38718055664 , 3.64932069411 , 3.87850569272 , 4.4113182732 , 2.60367705107 , 4.38603456884 , 3.76237502142 , 4.70449294799 , 4.48489780315 , 4.00217675235 , 3.69113872225 , 2.84381752466 , 2.64490642981 , 3.26550030106 , 3.11284322531 , 3.5278606601 , 2.73389921687 , 3.22909639958 , 9.68749273327 , 3.33794329991 , 1.82267761822 , 3.84960343354 , 3.34947114286 , 1.97525234047 , 4.80490149444 , 8.14703674908 , 2.85123026634 , 4.55860899603 , 3.8336676661 , 6.30110432527 , 5.03219707113 , 16.0849484556 , 2.45380197659 , 1.51388666902 , 1.93585020619 , 1.3686990979 , 1.79589742566 , 1.87033918163 , 2.1347025076 , 2.2107307156 , 2.00306285687 , 1.42081441613 , 2.25800807735 , 2.64485987569 , 1.57499868863 , 1.46970759794 , 2.14947144609 , 1.71494163207 , 1.42890994211 , 1.42921051412 , 2.56822992844 , 2.57491186436 , 2.24887120575 , 2.45006028512 , 2.29030145929 , 2.20357005345 , 2.37107043373 , 1.79574736231 , 2.16022404774 , 1.98744860352 , 2.76517152188 , 4.46927922498 , 2.28449240154 , 3.50934876462 , 3.43002757824 , 3.57237690717 , 3.74711858238 , 5.269319282 , 1.91724186837 , 2.37274846701 , 2.74429162252 , 4.33152677022 , 5.19693037903 , 4.14178144568 , 1.3717559139 , 5.10188377373 , 15.3319173641 , 2.72503824835 , 4.43168328127 , 2.77228298597 , 4.00000047582 , 2.78321470794 , 4.4266595246 , 12.3738675504 , 2.2362768749 , 3.53624063741 , 2.17194051215 , 1.80232955064 , 3.11447942993 , 5.58415288653 , 14.1053921526 , 8.57341416642 , 3.15187293847 , 2.76141329912 , 4.07248264248 , 1.99320484803 , 2.91473616599 , 2.20586857277 , 2.94563619851 , 5.42395269199 , 29.078302079 , 14.0218517407 , 20.5513224061 , 8.07341836515 , 6.53713071169 , 3.6100915748 , 2.98813230058 , 2.04783764553 , 2.60001717019 , 1.67795651189 , 2.92481559366 , 1.78590828584 , 0.883847519117 , 2.09792479628 , 2.77275673653 , 6.82743125648 , 2.05469069428 , 4.18963363872 , 5.88560779047 , 3.49943148138 , 2.40634975286 , 3.75794501409 , 3.99229239053 , 1.58456767841 , 3.45776889589 ] +# ftt1 = [ 3.31262327416 , 1.84214332676 , 1.11111111111 , 2.03014464168 , 1.93767258383 , 1.65447074293 , 9.03852728468 , 1.27301117686 , 1.26666666667 , 9.82712031558 , 10.434122288 , 10.373339908 , 9.46630506246 , 4.1728139382 , 5.41262327416 , 4.27879684418 , 6.29760026298 , 9.66288625904 , 11.6660420776 , 11.8333333333 , 10.6944444444 , 10.0307034845 , 3.57557527942 , 11.5675871137 , 10.4951347798 , 12.6495069034 , 8.61134122288 , 7.35282708744 , 15.2697238659 , 11.763477975 , 11.9313938199 , 5.16702827087 , 9.16988823143 , 13.1682117028 , 6.59408284024 , 11.0944444444 , 10.6555555556 , 9.95519395135 , 9.09247205786 , 6.50575279421 , 8.11604207758 , 7.55410913872 , 11.0204470743 , 9.8771860618 , 11.4343523997 , 12.8762656147 , 7.9865877712 , 9.08829717291 , 8.25016436555 , 5.91666666667 , 3.31130834977 , 9.45788954635 , 9.45358316897 , 11.9777120316 , 10.9437869822 , 12.5656147272 , 10.2722222222 , 12.8760026298 , 8.95239973702 , 10.3648915187 , 5.87370151216 , 4.64280078895 , 11.4609138725 , 12.0109467456 , 3.86985535832 , 2.52258382643 , 12.7899408284 , 12.5566732413 , 10.8793228139 , 8.65 , 3.78099934254 , 10.8026298488 , 7.08011176857 , 13.9724194609 , 8.85548980934 , 10.6792899408 , 1.92024983563 , 8.36048652202 , 10.8907626561 , 12.25539119 , 10.9333333333 , 8.59119000657 , 3.31245890861 , 6.69470742932 , 5.44224194609 , 8.9033530572 , 12.6318211703 , 8.3892504931 , 12.5443786982 , 11.1166666667 , 12.7669296515 , 5.2476660092 , 10.1997698882 , 7.16147271532 , 14.1570348455 , 12.6276134122 , 6.18612754767 , 8.52889546351 , 6.97771203156 , 5.6845496384 , 9.83563445102 , 4.45420775805 , 7.94322813938 , 11.9659763314 , 5.65262984878 , 11.1993754109 , 5.48007889546 , 3.85 , 7.94165023011 , 5.82501643655 , 13.3653188692 , 12.3447074293 , 8.30325443787 , 9.31564760026 , 1.98583168968 , 5.0335634451 , 3.27419460881 , 5.45749506903 , 9.69375410914 , 10.5053583169 , 5.52222222222 , 8.88484549638 , 4.34707429323 , 7.59566074951 , 11.1198224852 , 3.9771860618 , 14.2973701512 , 5.28652202498 , 9.70667324129 , 9.508382643 , 12.7611111111 , 8.00660749507 , 11.3608809993 , 15.2407955293 , 4.07712031558 , 11.8497370151 , 13.1331032216 , 11.6076265615 , 9.47376725838 , 5.78333333333 , 5.68783694938 , 5.93011176857 , 6.64806048652 , 5.23185404339 , 16.66617357 , 9.43609467456 , 2.10019723866 , 2.68957922419 , 4.42330703485 , 9.30023011177 , 10.2113412229 , 7.99375410914 , 8.58267587114 , 10.5413872452 , 5.42728468113 , 6.30785667324 , 8.36650230112 , 7.07001972387 , 8.60621301775 , 4.16111111111 , 5.93625904011 ] +# + time1 = [ 15.0 , 15.1 , 15.2 , 15.3 , 15.4 , 15.5 , 15.6 , 15.7 , 15.8 , 15.9 , 16.0 , 16.1 , 16.2 , 16.3 , 16.4 , 16.5 , 16.6 , 16.7 , 16.8 , 16.9 , 17.0 , 17.1 , 17.2 , 17.3 , 17.4 , 17.5 , 17.6 , 17.7 , 17.8 , 17.9 , 18.0 , 18.1 , 18.2 , 18.3 , 18.4 , 18.5 , 18.6 , 18.7 , 18.8 , 18.9 , 19.0 , 19.1 , 19.2 , 19.3 , 19.4 , 19.5 , 19.6 , 19.7 , 19.8 , 19.9 , 20.0 , 20.1 , 20.2 , 20.3 , 20.4 , 20.5 , 20.6 , 20.7 , 20.8 , 20.9 , 21.0 , 21.1 , 21.2 , 21.3 , 21.4 , 21.5 , 21.6 , 21.7 , 21.8 , 21.9 , 22.0 , 22.1 , 22.2 , 22.3 , 22.4 , 22.5 , 22.6 , 22.7 , 22.8 , 22.9 , 23.0 , 23.1 , 23.2 , 23.3 , 23.4 , 23.5 , 23.6 , 23.7 , 23.8 , 23.9 , 24.0 ] + oftt1 = [ 3.34016987043 , 2.11315860427 , 3.18601772454 , 2.27078098197 , 1.9420457237 , 1.78898985201 , 3.73454058499 , 1.68480930255 , 3.0386681039 , 2.85571865734 , 3.67601949705 , 3.79573983327 , 2.14938619725 , 3.30385990796 , 2.52350280827 , 2.78920221392 , 2.33322730245 , 1.98399477751 , 1.60538259827 , 1.6598521442 , 1.32650828772 , 1.77548607706 , 1.99973719458 , 2.6260890102 , 0.836643695985 , 3.07519345155 , 1.07249957761 , 2.00305118752 , 2.5596876696 , 3.60327651365 , 1.7923848476 , 2.93387600578 , 2.10630249637 , 2.62657712208 , 4.46121606175 , 3.67395466752 , 6.08488199517 , 2.82596124205 , 3.91241243228 , 2.41879102395 , 5.58772604829 , 5.46544361042 , 2.28721049498 , 2.77276299549 , 3.76564829102 , 2.98083742388 , 2.27925861381 , 4.62218104164 , 2.28501948578 , 3.05490472895 , 3.46676593792 , 3.92566641941 , 2.17956934145 , 1.37175933222 , 6.96433390259 , 2.01892635736 , 1.26722331867 , 2.8570576534 , 1.13259061279 , 1.95600833705 , 3.03595447335 , 2.68137884379 , 2.422802909 , 1.68415431027 , 6.4498319049 , 3.96220874586 , 4.69988034974 , 4.07102932834 , 10.7651747519 , 1.81898918617 , 4.65267675925 , 6.19047595255 , 9.03167793854 , 6.76516119096 , 9.09661653142 , 5.77479201038 , 5.02901085492 , 7.21128650775 , 9.02549607313 , 4.47327569073 , 6.31552038723 , 3.84705878877 , 4.93029548398 , 7.19598955666 , 2.89317645075 , 2.24624292048 , 19.8300025219 , 16.3631961495 , 5.65725732509 , 7.03276276214 , 7.74351929772 ] + ofpt1 = [ 3.33126992611 , 2.15235043881 , 4.21215375236 , 2.04146402499 , 2.26508236112 , 1.75842743987 , 3.83752010319 , 1.79356812562 , 2.71647871756 , 2.98920028076 , 3.06963761795 , 3.78037524154 , 2.11330949347 , 3.62306600989 , 2.10132375418 , 2.79890211351 , 2.45220911956 , 2.0962944359 , 1.71888897623 , 2.00237892092 , 2.00237892092 , 1.75017286044 , 1.87819485903 , 2.77200592938 , 0.927552735382 , 2.16110258543 , 0.952612535679 , 1.55876494568 , 2.43936505277 , 2.74032154014 , 2.20187230613 , 2.62732676781, 1.81709347884 , 2.68646819361 , 4.87840695719 , 3.58804992604 , 1.96027598281 , 2.16400733578 , 4.55698744552 , 2.61612107743 , 4.1007299461 , 2.60197595024 , 2.42772928849 , 3.70504358394 , 2.64089183244 , 2.53083484208 , 2.69596558723 , 3.82189848477 , 2.10858933652 , 2.69381421149 , 4.48942308279 , 3.48776778082 , 1.75831208948 , 1.48030854681 , 3.2901866737 , 2.33799936521 , 1.50491990853 , 1.23953538087 , 1.19008302381 , 2.36576100342, 2.57888534853 , 2.052794471 , 2.64644323686 , 1.35534774334 , 5.6573022579 , 4.76819909982 , 1.85043233584 , 3.46190356262 , 5.28356384041 , 1.84882416982 , 3.01211103176 , 4.59728665448 , 8.01181670627 , 6.44190774176 , 7.57429158629 , 5.66900034971 , 4.30244931982 , 6.23339404063 , 6.88638460847 , 4.63713969717 , 5.75838213042 , 3.38303474858 , 4.29114582128 , 2.74825804228 , 2.33363923855 , 2.26640425042 , 4.06245325649 , 3.02492973852 , 4.13263598916, 4.06968874886 , 3.87911988994] + ftt1 = [ 11.9777777778 , 5.30444444444 , 6.60555555556 , 5.95777777778 , 12.5111111111 , 9.20444444444 , 7.46666666667 , 5.53777777778 , 8.21333333333 , 6.09333333333 , 7.58333333333 , 5.55333333333 , 8.17 , 12.5644444444 , 5.17 , 12.4677777778 , 6.09444444444 , 4.99666666667 , 6.82777777778 , 5.94777777778 , 11.0944444444 , 10.26 , 5.23666666667 , 7.97 , 1.59666666667 , 7.39333333333 , 2.73333333333 , 4.52222222222 , 13.65 , 9.81888888889 , 5.72222222222 , 4.58444444444 , 4.84666666667 , 6.91111111111 , 9.93 , 4.4 , 13.1433333333 , 5.34333333333 , 9.29 , 8.00111111111 , 11.3344444444 , 8.30888888889 , 13.0066666667 , 9.40888888889 , 3.65 , 9.62 , 15.25 , 9.95666666667 , 6.53333333333 , 4.36111111111 , 6.1 , 5.91666666667 , 4.94666666667 , 3.92 , 13.6955555556 , 9.13777777778 , 1.22333333333 , 2.35555555556 , 4.62 , 7.94333333333 , 9.09333333333 , 6.67333333333 , 7.17555555556 , 8.79777777778 , 5.32111111111 , 8.37 , 9.10444444444 , 4.39333333333 , 7.40111111111 , 3.44 , 3.62333333333 , 5.64111111111 , 6.80555555556 , 8.66333333333 , 9.05111111111 , 10.2 , 5.94333333333 , 6.72888888889 , 6.26888888889 , 4.31666666667 , 9.28888888889 , 9.24 , 6.27111111111 , 12.4866666667 , 3.67666666667 , 7.58777777778 , 3.85 , 4.34666666667 , 6.28 , 6.28 , 6.28 ] time = [] - traf= [] - occ = [] - for time10 in range(160,240,1): + oftt= [] + ftt = [] + ofpt = [] + for time10 in range(200,221,1): time01 = time10 / 10.0 for i in range(len(time1)): if time1[i] == time01: - time.append(time1[i]) - traf.append(traf1[i]) - occ.append(occ1[i]) + oftt.append(oftt1[i]) + ftt.append(ftt1[i]) + ofpt.append(ofpt1[i]) break + print 'MEAN - oftt: ',np.mean(oftt) + print 'MEAN - ftt:', np.mean(ftt) + #print 'MEAN - ofpt: ', np.mean(ofpt) - time.append(time1[-1]) - traf.append(traf1[-1]) - occ.append(occ1[-1]) - print 'MEAN -occ: ',np.mean(occ) - print 'MEAN - traf:', np.mean(traf) -# cntT = 0 -# cntO = 0 -# for i in range(len(traf)): -# if traf[i] < occ[i]: -# cntT += 1 -# else: -# cntO += 1 -# print "T win: ", cntT -# print "O win: ", cntO - - xlim(20, 22) - ylim(0,1) fig = plt.figure(1) errorDis1 = plt.subplot(1,1,1) ax=plt.gca() for tick in ax.xaxis.get_major_ticks(): - tick.label1.set_fontsize(40) + tick.label1.set_fontsize(xfontsize) for tick in ax.yaxis.get_major_ticks(): - tick.label1.set_fontsize(40) - errorDis1.set_xlabel('Time',size=50) - errorDis1.set_ylabel('Weight',size=50) - errorDis1.plot(time,occ,'sk-',label='Occupancy', linewidth=2.5, markersize=30,markerfacecolor='k',markeredgecolor='k') - errorDis1.plot(time,traf,'*r--',label='Traffic', linewidth = 2.5, markersize=40,markerfacecolor='r',markeredgecolor='r') - errorDis1.legend(bbox_to_anchor=(0.5, 0.6), prop={'size':40}) + tick.label1.set_fontsize(yfontsize) + xlim(20,22) + #xlim(16,24) + ylim(0,15) + errorDis1.set_xlabel('Time',size=xlabelsize) + errorDis1.set_ylabel('MSE',size=ylabelsize) + errorDis1.plot(time,oftt,'pb-',label='TPO-T', linewidth=lwidth, markersize=psize,markerfacecolor='none',markeredgecolor='b',markeredgewidth=mewidth) + #errorDis1.plot(time,ofpt,'*r--',label='TPO-P', linewidth = 2.5, markersize=40,markerfacecolor='r',markeredgecolor='r') + errorDis1.plot(time,ftt,'^r--',label='TP-T', linewidth = lwidth, markersize=trisize,markerfacecolor='none',markeredgecolor='r',markeredgewidth=mewidth) + errorDis1.legend(bbox_to_anchor=(0.8, 1), prop={'size':legendsize}) + #errorDis1.legend(bbox_to_anchor=(0, 0.8), loc=0, borderaxespad=0.,prop={'size':40}) + plt.grid(True, linewidth = gridwidth) plt.show() -elif graph == 32:#Lin Cheung - TFO-PT VS TF-P, 3 months training, 1 months testing - time1 = [ 16.0 , 16.1 , 16.2 , 16.3 , 16.4 , 16.5 , 16.6 , 16.7 , 16.8 , 16.9 , 17.0 , 17.1 , 17.2 , 17.3 , 17.4 , 17.5 , 17.6 , 17.7 , 17.8 , 17.9 , 18.0 , 18.1 , 18.2 , 18.3 , 18.4 , 18.5 , 18.6 , 18.7 , 18.8 , 18.9 , 19.0 , 19.1 , 19.2 , 19.3 , 19.4 , 19.5 , 19.6 , 19.7 , 19.8 , 19.9 , 20.0 , 20.1 , 20.2 , 20.3 , 20.4 , 20.5 , 20.6 , 20.7 , 20.8 , 20.9 , 21.0 , 21.1 , 21.2 , 21.3 , 21.4 , 21.5 , 21.6 , 21.7 , 21.8 , 21.9 , 22.0 , 22.1 , 22.2 , 22.3 , 22.4 , 22.5 , 22.6 , 22.7 , 22.8 , 22.9 , 23.0 , 23.1 , 23.2 , 23.3 , 23.4 , 23.5 , 23.6 , 23.7 , 23.8 , 23.9 , 24.0 ] - occ1 = [ 5.49903483304 , 4.08265701586 , 10.025271142 , 17.6552033394 , 13.2237366115 , 5.47613895792 , 0.999758928022 , 1.58711989743 , 2.0055282384 , 2.1762483477 , 1.73805082226 , 0.925511037505 , 0.282112288671 , 0.995161099272 , 2.40809123039 , 0.705628833421 , 17.0599761833 , 10.1265743368 , 1.23352766927 , 1.66678462689 , 4.12599619707 , 4.20207804778 , 5.08359786969 , 3.37620211195 , 5.44981027191 , 2.60980002033 , 0.605548177339 , 1.62003962564 , 3.65787863662 , 5.44122935535 , 1.24536231033 , 4.97688619599 , 2.29404395639 , 16.5215749878 , 16.477812214 , 1.19479874357 , 1.94751724097 , 1.51747847861 , 1.51337594337 , 1.44757955587 , 9.07519900694 , 19.3205133236 , 20.694716424 , 0.449683376685 , 1.26411640809 , 2.10787602288 , 0.669587301723 , 0.634732322848 , 0.723407961919 , 1.89994612636 , 1.8721431028 , 0.825934537096 , 1.87151292795 , 3.19554801719 , 1.21571822811 , 0.635516491212 , 0.871681752366 , 0.347386594626 , 0.472373830237 , 0.532537463031 , 5.65389737685 , 1.34112885695 , 0.922471754123 , 2.94232225242 , 0.774735359774 , 0.645233042387 , 0.902233503422 , 2.06389199982 , 0.941009226952 , 4.7263331494 , 7.78727529189 , 28.4892345328 , 22.8343622882 , 0.454738553954 , 0.51763448394 , 0.629275560727 , 0.337179453659 , 0.394342062886 , 0.483797390261 , 0.481537033558 , 1.19820899855 ] - traf1 = [ 5.67034912902 , 3.4439361993 , 7.41826198014 , 12.2542358573 , 9.28203790162 , 5.86881015359 , 2.74121015261 , 2.43203836572 , 1.56769559353 , 2.29906347435 , 2.19519642645 , 3.76270787453 , 2.60791922839 , 1.93977440675 , 2.22490763293 , 2.1285169511 , 12.0268924432 , 8.75495020281 , 1.51164982502 , 1.7262822417 , 3.69702882167 , 5.17441326713 , 3.91906176782 , 3.24130229581 , 4.36181903615 , 2.06036518521 , 0.863133464832 , 1.88208246395 , 3.79041757886 , 6.08279658256 , 4.64154595031 , 5.09382003718 , 3.59051814473 , 11.7662128781 , 13.3825697739 , 1.04480363183 , 1.75460440286 , 1.92492904929 , 2.35518835321 , 4.39700066378 , 10.5874467744 , 19.0551710251 , 22.02362077 , 10.7710691987 , 25.3702078592 , 13.8407086908 , 11.7838011769 , 9.45152399524 , 7.67663240032 , 3.53185195857 , 6.26581398446 , 10.2999464928 , 27.4767195669 , 1.20030632239 , 1.06412381931 , 0.75215874301 , 0.797127220553 , 0.418335430494 , 0.387485269692 , 0.746547344465 , 2.30934764997 , 1.13401107389 , 1.18226625051 , 2.4639587413 , 1.03275962596 , 1.04058915034 , 1.02561195806 , 0.717555965534 , 0.752406516688 , 3.35712889926 , 6.13955660405 , 20.7402572695 , 16.4197585943 , 0.647778847426 , 0.500274852399 , 0.612234609617 , 0.396466438523 , 0.328438554444 , 0.458621687999 , 0.457650006252 , 0.781134210783 ] - time = [] - traf= [] - occ = [] - for time10 in range(200,220,1): - time01 = time10 / 10.0 - for i in range(len(time1)): - if time1[i] == time01: - if time1[i] == 21.2: - print traf1[i], occ1[i] - print (traf1[i]-occ1[i])/traf1[i] - time.append(time1[i]) - traf.append(traf1[i]) - occ.append(occ1[i]) - break - - time.append(time1[-1]) - traf.append(traf1[-1]) - occ.append(occ1[-1]) - print 'MEAN - occ: ',np.mean(occ) - print 'MEAN - traf:', np.mean(traf) - - xlim(20, 22) - #ylim(0,20) - fig = plt.figure(1) - errorDis1 = plt.subplot(1,1,1) - ax=plt.gca() - for tick in ax.xaxis.get_major_ticks(): - tick.label1.set_fontsize(40) - for tick in ax.yaxis.get_major_ticks(): - tick.label1.set_fontsize(40) - errorDis1.set_xlabel('Time',size=50) - errorDis1.set_ylabel('MSE',size=50) - errorDis1.plot(time,occ,'sk-',label='TFO-P', linewidth=2.5, markersize=30,markerfacecolor='k',markeredgecolor='k') - errorDis1.plot(time,traf,'*r--',label='TF-P', linewidth = 2.5, markersize=40,markerfacecolor='r',markeredgecolor='r') - errorDis1.legend(bbox_to_anchor=(1, 1), prop={'size':40}) - plt.show() -elif graph == 33:#Lin Cheung - TFO-TT VS TFO-PT VS TF-T + +#elif graph == 33:#Lin Cheung - TPO-TT VS TPO-PT VS TP-T +# time1 = [ 16.0 , 16.1 , 16.2 , 16.3 , 16.4 , 16.5 , 16.6 , 16.7 , 16.8 , 16.9 , 17.0 , 17.1 , 17.2 , 17.3 , 17.4 , 17.5 , 17.6 , 17.7 , 17.8 , 17.9 , 18.0 , 18.1 , 18.2 , 18.3 , 18.4 , 18.5 , 18.6 , 18.7 , 18.8 , 18.9 , 19.0 , 19.1 , 19.2 , 19.3 , 19.4 , 19.5 , 19.6 , 19.7 , 19.8 , 19.9 , 20.0 , 20.1 , 20.2 , 20.3 , 20.4 , 20.5 , 20.6 , 20.7 , 20.8 , 20.9 , 21.0 , 21.1 , 21.2 , 21.3 , 21.4 , 21.5 , 21.6 , 21.7 , 21.8 , 21.9 , 22.0 , 22.1 , 22.2 , 22.3 , 22.4 , 22.5 , 22.6 , 22.7 , 22.8 , 22.9 , 23.0 , 23.1 , 23.2 , 23.3 , 23.4 , 23.5 , 23.6 , 23.7 , 23.8 , 23.9 , 24.0 ] +# occ1 = [ 5.49903483304 , 4.08265701586 , 10.025271142 , 17.6552033394 , 13.2237366115 , 5.47613895792 , 0.999758928022 , 1.58711989743 , 2.0055282384 , 2.1762483477 , 1.73805082226 , 0.925511037505 , 0.282112288671 , 0.995161099272 , 2.40809123039 , 0.705628833421 , 17.0599761833 , 10.1265743368 , 1.23352766927 , 1.66678462689 , 4.12599619707 , 4.20207804778 , 5.08359786969 , 3.37620211195 , 5.44981027191 , 2.60980002033 , 0.605548177339 , 1.62003962564 , 3.65787863662 , 5.44122935535 , 1.24536231033 , 4.97688619599 , 2.29404395639 , 16.5215749878 , 16.477812214 , 1.19479874357 , 1.94751724097 , 1.51747847861 , 1.51337594337 , 1.44757955587 , 9.07519900694 , 19.3205133236 , 20.694716424 , 0.449683376685 , 1.26411640809 , 2.10787602288 , 0.669587301723 , 0.634732322848 , 0.723407961919 , 1.89994612636 , 1.8721431028 , 0.825934537096 , 1.87151292795 , 3.19554801719 , 1.21571822811 , 0.635516491212 , 0.871681752366 , 0.347386594626 , 0.472373830237 , 0.532537463031 , 5.65389737685 , 1.34112885695 , 0.922471754123 , 2.94232225242 , 0.774735359774 , 0.645233042387 , 0.902233503422 , 2.06389199982 , 0.941009226952 , 4.7263331494 , 7.78727529189 , 28.4892345328 , 22.8343622882 , 0.454738553954 , 0.51763448394 , 0.629275560727 , 0.337179453659 , 0.394342062886 , 0.483797390261 , 0.481537033558 , 1.19820899855 ] +# traf1 = [ 5.57239074764 , 3.94463027271 , 9.82187627072 , 17.6637747418 , 12.8078583137 , 4.98896303131 , 1.26044276869 , 0.761849528199 , 1.47718154615 , 1.99213178602 , 0.355741634508 , 0.442311675517 , 0.201809214452 , 0.365020546082 , 1.86369509938 , 1.21801716357 , 17.3881640899 , 10.0320657159 , 1.19726139889 , 0.571420452441 , 4.18142674465 , 4.31058266454 , 4.78018596297 , 3.28576012223 , 5.85050167165 , 2.70739575173 , 0.421337122472 , 0.496463139899 , 3.28355012424 , 5.34929069964 , 1.23804118318 , 5.1420406618 , 2.29927835034 , 16.6873265139 , 16.435394319 , 0.376377976438 , 2.72118541206 , 1.47441761914 , 1.34107164574 , 1.61090260254 , 8.87085478669 , 17.7458935979 , 27.6341018413 , 2.14146348178 , 1.13110076716 , 4.08295899489 , 0.65407135873 , 3.97976284942 , 3.14643530165 , 1.98292621383 , 4.61209657007 , 0.748269981314 , 1.58598371097 , 0.77671194209 , 0.285708092695 , 0.437693416825 , 0.925092915916 , 0.31978273665 , 0.403664081267 , 0.532834639837 , 0.4830288381 , 0.918549790777 , 0.761965852527 , 0.754987466884 , 0.439885758927 , 0.675604906839 , 0.835107677073 , 1.18418686689 , 0.84401725515 , 4.88466318727 , 7.63040683748 , 29.0859820268 , 22.6893571698 , 0.442177546547 , 0.523817661237 , 0.650807723773 , 0.340159154395 , 0.304019809615 , 0.426296869885 , 0.42629119812 , 0.426278103343 ] +# ha1 = [ 5.89444444444 , 3.18777777778 , 7.46333333333 , 12.2277777778 , 10.2844444444 , 5.73333333333 , 2.99111111111 , 2.57888888889 , 1.78666666667 , 2.32666666667 , 1.96 , 3.97 , 2.43666666667 , 1.53333333333 , 1.89 , 3.62222222222 , 12.4722222222 , 8.70666666667 , 1.69333333333 , 1.95555555556 , 5.05 , 6.12 , 4.72222222222 , 3.77 , 4.95777777778 , 2.05555555556 , 0.568888888889 , 1.67777777778 , 3.78333333333 , 5.91666666667 , 4.59666666667 , 4.94666666667 , 3.41333333333 , 12.1044444444 , 13.5255555556 , 1.02444444444 , 2.25555555556 , 2.05888888889 , 2.31555555556 , 4.59666666667 , 11.9833333333 , 19.9788888889 , 25.1888888889 , 10.6177777778 , 19.3833333333 , 15.0088888889 , 15.6722222222 , 13.2555555556 , 16.0633333333 , 17.7844444444 , 20.9 , 14.3088888889 , 18.3566666667 , 10.78 , 4.71666666667 , 0.507777777778 , 0.907777777778 , 0.5 , 0.393333333333 , 0.724444444444 , 0.57 , 0.822222222222 , 0.903333333333 , 0.822222222222 , 0.57 , 0.726666666667 , 0.713333333333 , 0.762222222222 , 0.866666666667 , 3.43666666667 , 6.21888888889 , 20.6988888889 , 16.4911111111 , 0.646666666667 , 0.506666666667 , 0.613333333333 , 0.374444444444 , 0.343333333333 , 0.432222222222 , 0.432222222222 , 0.432222222222 ] +# +# time = [] +# traf= [] +# occ = [] +# ha = [] +# for time10 in range(160,240,10): +# time01 = time10 / 10.0 +# +# for i in range(len(time1)): +# if time1[i] == time01: +# if time1[i] == 21: +# print (traf1[i]-occ1[i])/traf1[i] +# time.append(time1[i]) +# traf.append(traf1[i]) +# occ.append(occ1[i]) +# ha.append(ha1[i]) +# break +# +# time.append(time1[-1]) +# traf.append(traf1[-1]) +# occ.append(occ1[-1]) +# ha.append(ha[-1]) +# print 'MEAN - occ p: ',np.mean(occ) +# print 'MEAN - occ t:', np.mean(traf) +# print 'MEAN - traf t:', np.mean(ha) +# +# #xlim(20, 22) +# #ylim(0,20) +# fig = plt.figure(1) +# errorDis1 = plt.subplot(1,1,1) +# ax=plt.gca() +# for tick in ax.xaxis.get_major_ticks(): +# tick.label1.set_fontsize(40) +# for tick in ax.yaxis.get_major_ticks(): +# tick.label1.set_fontsize(40) +# errorDis1.set_xlabel('Time',size=50) +# errorDis1.set_ylabel('MSE',size=50) +# errorDis1.plot(time,ha,'.b--',label='TP-T', linewidth=2.5, markersize=60,markerfacecolor='b',markeredgecolor='b') +# errorDis1.plot(time,occ,'*r--',label='TPO-P', linewidth=2.5, markersize=40,markerfacecolor='r',markeredgecolor='r') +# errorDis1.plot(time,traf,'sk-',label='TPO-T', linewidth = 2.5, markersize=30,markerfacecolor='k',markeredgecolor='k') +# errorDis1.legend(bbox_to_anchor=(1, 1), prop={'size':40}) +# plt.grid(True, linewidth = 3) +# plt.show() +elif graph == 33.4:#TPO-T VS TPO-P +#the Mean Percentage of Difference as a function of time. time1 = [ 16.0 , 16.1 , 16.2 , 16.3 , 16.4 , 16.5 , 16.6 , 16.7 , 16.8 , 16.9 , 17.0 , 17.1 , 17.2 , 17.3 , 17.4 , 17.5 , 17.6 , 17.7 , 17.8 , 17.9 , 18.0 , 18.1 , 18.2 , 18.3 , 18.4 , 18.5 , 18.6 , 18.7 , 18.8 , 18.9 , 19.0 , 19.1 , 19.2 , 19.3 , 19.4 , 19.5 , 19.6 , 19.7 , 19.8 , 19.9 , 20.0 , 20.1 , 20.2 , 20.3 , 20.4 , 20.5 , 20.6 , 20.7 , 20.8 , 20.9 , 21.0 , 21.1 , 21.2 , 21.3 , 21.4 , 21.5 , 21.6 , 21.7 , 21.8 , 21.9 , 22.0 , 22.1 , 22.2 , 22.3 , 22.4 , 22.5 , 22.6 , 22.7 , 22.8 , 22.9 , 23.0 , 23.1 , 23.2 , 23.3 , 23.4 , 23.5 , 23.6 , 23.7 , 23.8 , 23.9 , 24.0 ] - occ1 = [ 5.49903483304 , 4.08265701586 , 10.025271142 , 17.6552033394 , 13.2237366115 , 5.47613895792 , 0.999758928022 , 1.58711989743 , 2.0055282384 , 2.1762483477 , 1.73805082226 , 0.925511037505 , 0.282112288671 , 0.995161099272 , 2.40809123039 , 0.705628833421 , 17.0599761833 , 10.1265743368 , 1.23352766927 , 1.66678462689 , 4.12599619707 , 4.20207804778 , 5.08359786969 , 3.37620211195 , 5.44981027191 , 2.60980002033 , 0.605548177339 , 1.62003962564 , 3.65787863662 , 5.44122935535 , 1.24536231033 , 4.97688619599 , 2.29404395639 , 16.5215749878 , 16.477812214 , 1.19479874357 , 1.94751724097 , 1.51747847861 , 1.51337594337 , 1.44757955587 , 9.07519900694 , 19.3205133236 , 20.694716424 , 0.449683376685 , 1.26411640809 , 2.10787602288 , 0.669587301723 , 0.634732322848 , 0.723407961919 , 1.89994612636 , 1.8721431028 , 0.825934537096 , 1.87151292795 , 3.19554801719 , 1.21571822811 , 0.635516491212 , 0.871681752366 , 0.347386594626 , 0.472373830237 , 0.532537463031 , 5.65389737685 , 1.34112885695 , 0.922471754123 , 2.94232225242 , 0.774735359774 , 0.645233042387 , 0.902233503422 , 2.06389199982 , 0.941009226952 , 4.7263331494 , 7.78727529189 , 28.4892345328 , 22.8343622882 , 0.454738553954 , 0.51763448394 , 0.629275560727 , 0.337179453659 , 0.394342062886 , 0.483797390261 , 0.481537033558 , 1.19820899855 ] - traf1 = [ 5.57239074764 , 3.94463027271 , 9.82187627072 , 17.6637747418 , 12.8078583137 , 4.98896303131 , 1.26044276869 , 0.761849528199 , 1.47718154615 , 1.99213178602 , 0.355741634508 , 0.442311675517 , 0.201809214452 , 0.365020546082 , 1.86369509938 , 1.21801716357 , 17.3881640899 , 10.0320657159 , 1.19726139889 , 0.571420452441 , 4.18142674465 , 4.31058266454 , 4.78018596297 , 3.28576012223 , 5.85050167165 , 2.70739575173 , 0.421337122472 , 0.496463139899 , 3.28355012424 , 5.34929069964 , 1.23804118318 , 5.1420406618 , 2.29927835034 , 16.6873265139 , 16.435394319 , 0.376377976438 , 2.72118541206 , 1.47441761914 , 1.34107164574 , 1.61090260254 , 8.87085478669 , 17.7458935979 , 27.6341018413 , 2.14146348178 , 1.13110076716 , 4.08295899489 , 0.65407135873 , 3.97976284942 , 3.14643530165 , 1.98292621383 , 4.61209657007 , 0.748269981314 , 1.58598371097 , 0.77671194209 , 0.285708092695 , 0.437693416825 , 0.925092915916 , 0.31978273665 , 0.403664081267 , 0.532834639837 , 0.4830288381 , 0.918549790777 , 0.761965852527 , 0.754987466884 , 0.439885758927 , 0.675604906839 , 0.835107677073 , 1.18418686689 , 0.84401725515 , 4.88466318727 , 7.63040683748 , 29.0859820268 , 22.6893571698 , 0.442177546547 , 0.523817661237 , 0.650807723773 , 0.340159154395 , 0.304019809615 , 0.426296869885 , 0.42629119812 , 0.426278103343 ] - ha1 = [ 5.89444444444 , 3.18777777778 , 7.46333333333 , 12.2277777778 , 10.2844444444 , 5.73333333333 , 2.99111111111 , 2.57888888889 , 1.78666666667 , 2.32666666667 , 1.96 , 3.97 , 2.43666666667 , 1.53333333333 , 1.89 , 3.62222222222 , 12.4722222222 , 8.70666666667 , 1.69333333333 , 1.95555555556 , 5.05 , 6.12 , 4.72222222222 , 3.77 , 4.95777777778 , 2.05555555556 , 0.568888888889 , 1.67777777778 , 3.78333333333 , 5.91666666667 , 4.59666666667 , 4.94666666667 , 3.41333333333 , 12.1044444444 , 13.5255555556 , 1.02444444444 , 2.25555555556 , 2.05888888889 , 2.31555555556 , 4.59666666667 , 11.9833333333 , 19.9788888889 , 25.1888888889 , 10.6177777778 , 19.3833333333 , 15.0088888889 , 15.6722222222 , 13.2555555556 , 16.0633333333 , 17.7844444444 , 20.9 , 14.3088888889 , 18.3566666667 , 10.78 , 4.71666666667 , 0.507777777778 , 0.907777777778 , 0.5 , 0.393333333333 , 0.724444444444 , 0.57 , 0.822222222222 , 0.903333333333 , 0.822222222222 , 0.57 , 0.726666666667 , 0.713333333333 , 0.762222222222 , 0.866666666667 , 3.43666666667 , 6.21888888889 , 20.6988888889 , 16.4911111111 , 0.646666666667 , 0.506666666667 , 0.613333333333 , 0.374444444444 , 0.343333333333 , 0.432222222222 , 0.432222222222 , 0.432222222222 ] - + diff = [] + occ16 = [58.920621425008449, 58.291577091475219, 59.32294102666107, 58.518773321619868, 58.87247933148354, 58.836231372682484, 59.179407677396966, 58.899737397766756, 58.920695547726083, 58.597767224241245, 59.04375628032745, 58.75574316360138, 59.622693078707535, 58.652352255611049, 58.909935842210096, 58.828047158709246, 59.094413053126431, 59.38699857527974, 58.998641045169713, 58.198583478889596, 59.538340558365007] + traf16 = [58.02425600324846, 58.01960023452137, 58.597760158612267, 58.667269678785175, 59.229996889627166, 59.165108488464107, 59.510397999640958, 59.459613524606958, 59.476945771247259, 59.913658904321871, 59.53489783230247, 60.898997220058128, 60.041461612433118, 60.728810513125921, 60.384488653862768, 60.572777542565461, 60.226148387610209, 59.921958992455892, 59.716303946259075, 59.903868606187068, 60.035935098737106] + t = np.mean(np.abs(np.array(occ16)-np.array(traf16))/np.array(occ16)) + diff.append(t) + occ17 = [58.819110907218089, 58.754440850740252, 58.707566598243211, 58.691671314068877, 58.758768758296462, 58.693374206687253, 58.79395041937714, 58.825970794828692, 58.799346076728348, 58.705427701363377, 58.665535340936685, 58.866990631146201, 58.773317862360578, 58.799104491440758, 58.842071482687309, 58.777559913611604, 58.804107070134286, 58.889079660011667, 58.738712233540099, 58.77692611422853, 58.744114787827947] + traf17 = [58.857216955487154, 58.857097391956202, 58.857092900762709, 58.857148285401273, 58.857271938715215, 58.857009630910305, 58.857328701522938, 58.857208820699242, 58.857076397208509, 58.857311090749775, 58.85723159789579, 58.857567834018489, 58.857425964079084, 58.857285475707634, 58.857516494997228, 58.857482137116484, 58.857526844117473, 58.857433327552037, 58.857319473188369, 58.857307600931456, 58.857373663813377] + t = np.mean(np.abs(np.array(occ17)-np.array(traf17))/np.array(occ17)) + diff.append(t) + occ18 = [58.447769637707772, 58.366154904081149, 58.730416828547575, 59.024014142002422, 58.22982464557392, 58.640574644085966, 58.764229639154081, 58.719729935365841, 58.670967537145501, 58.864195872538637, 58.806820474500697, 58.592547678126081, 58.938344633399268, 58.527407224811228, 58.63196901393249, 59.011548917637107, 58.606296098351109, 58.582475829969361, 58.671356274513172, 58.454252929307778, 58.627615925678036] + traf18 = [57.974903990235276, 59.313686949756338, 59.042842517656794, 59.030825848988719, 57.895499847288448, 58.468600324564846, 58.667218396378424, 58.699564675518737, 57.886131370242389, 58.98029950379771, 58.403788063094709, 57.440817964341498, 58.147095013987837, 57.434060496315404, 58.71920443881622, 58.401837892532043, 58.562934404883372, 58.328064094081007, 58.35028761102074, 58.184386179235815, 58.252856747597839] + t = np.mean(np.abs(np.array(occ18)-np.array(traf18))/np.array(occ18)) + diff.append(t) + occ19 = [58.555037814836311, 58.936393832203365, 58.589226966559629, 58.155545770382076, 58.205453236714149, 58.448309518584907, 58.25920046722954, 59.497570305311072, 58.440651250943446, 58.762359530958292, 58.99015307298825, 58.438368231684436, 58.512435664946288, 58.419270420991495, 58.496861544770965, 58.177733088116561, 58.476850541288108, 58.228870517925472, 58.424488254722625, 58.387422167887898, 58.409390453609454] + traf19 = [59.228085002760288, 59.094069442683448, 59.38853420959591, 59.97813944490975, 58.260686351578194, 58.300288958066879, 58.19193951035934, 58.20970569260222, 57.893899005531807, 58.170879420292657, 57.945424917571017, 57.673863709660623, 57.861536830764528, 58.001963891056668, 57.783551871005372, 58.065421153569027, 57.78562450192117, 57.550921828002018, 58.082562904649023, 58.151306938099061, 57.739278250990509] + t = np.mean(np.abs(np.array(occ19)-np.array(traf19))/np.array(occ19)) + diff.append(t) + occ20 = [59.294513999253304, 58.931649923731186, 59.530798058866878, 58.648758165487834, 59.570298718257916, 59.063033574754179, 58.900275122566747, 59.602183385946823, 59.46573645982707, 59.658626071221853, 59.793530881061216, 60.245556545510354, 59.492015063326981, 59.044903637092091, 59.796526927502718, 58.613187952693359, 59.627741116562298, 58.473638844341963, 59.954545371782764, 58.117813390860881, 60.082419453326885] + traf20 = [59.429282575434939, 59.382571494913584, 59.330274832261587, 59.28235656329035, 59.017454812409078, 59.127509579600265, 59.008075984387332, 58.943565191212862, 58.802070410325555, 58.95216471492688, 59.00535840552871, 58.669444873041215, 58.845181397003884, 58.717786909985186, 58.796368017256583, 59.1035962541036, 58.951571723183669, 58.93716939139675, 58.950377435733458, 58.845205052341264, 58.852435278093516] + t = np.mean(np.abs(np.array(occ20)-np.array(traf20))/np.array(occ20)) + diff.append(t) + occ21 = [63.134976389584118, 63.405328773536496, 63.022932289179764, 63.593816507071921, 63.417241302998001, 63.257910052549406, 63.243446343930202, 63.246259625203187, 63.654006493057437, 63.946756160407944, 63.318866368035124, 63.423860203386802, 63.809153147762842, 63.225209091880565, 63.267845375124267, 63.511181376241602, 63.368189494434674, 63.432380588569039, 63.942082646980836, 63.046744689149229, 63.786257085620562] + traf21 = [64.036451631789618, 64.009926977242003, 64.014921289345452, 63.97658355339432, 63.998058992942354, 63.874142845261908, 64.026921282202579, 63.94747406702475, 64.018169099547634, 64.034789456935272, 64.064583992810086, 64.028526851809232, 64.023166906673978, 64.11046642200246, 64.039860323248703, 64.020151767239497, 64.080874508225435, 64.009579519725492, 64.035839358094947, 64.070946753162019, 64.089342573556863] + t = np.mean(np.abs(np.array(occ21)-np.array(traf21))/np.array(occ21)) + diff.append(t) + occ22 = [66.068646487838649, 65.231697872899204, 65.579095187064297, 65.907918320189907, 64.980206231479869, 65.976068175288148, 65.913910513310185, 65.968362816357427, 66.385849920371854, 66.023987873361406, 66.097527474567997, 65.828888852474435, 66.489018871206639, 66.066683243151715, 65.895392456622233, 65.676364698229733, 66.154104847306158, 66.381244066382976, 65.869619618572713, 65.882249675567593, 66.041606632709986] + traf22 = [67.744419179802222, 66.290201457531211, 67.082632005715027, 64.759155036595814, 64.526196619043816, 65.782943852570043, 65.684911932533552, 65.094627786467271, 63.889034043192886, 64.535707675397944, 64.911476687761834, 64.029079184927923, 64.673697914079909, 64.125917781049949, 63.902024524594708, 64.442017163590506, 64.300437780333766, 65.204559660828693, 65.067125561960111, 65.22547733822752, 63.69088489022775] + t = np.mean(np.abs(np.array(occ22)-np.array(traf22))/np.array(occ22)) + diff.append(t) + occ23 = [64.022879028135804, 64.375388034386049, 63.707001483897244, 62.77123683985247, 63.787611710591229, 64.4704324650492, 64.23936125342783, 63.058109924787793, 64.051982392766519, 64.317631335296397, 64.34418131726467, 64.216581560061769, 63.748760565300216, 63.996745758346435, 64.178553199765858, 63.130916827614321, 64.732960506817307, 64.127522448991186, 63.884141000750184, 64.302017512624076, 63.760853152356937] + traf23 = [64.348551960471056, 64.892807261225585, 64.558699790169001, 66.602126339369065, 66.050416719474413, 65.83961943889048, 65.951458217704641, 66.754082278226193, 66.349351452010623, 65.78780821503284, 65.950348682026828, 66.104184610943634, 66.841207257042456, 66.975119518869647, 66.642962009930059, 66.665549054887208, 66.242097646935989, 65.834767907377838, 65.459705349872692, 66.609761334298256, 66.336729859111685] + t = np.mean(np.abs(np.array(occ23)-np.array(traf23))/np.array(occ23)) + diff.append(t) + occ24 = [68.592816236898898, 67.677222857555719, 67.439861415265099, 66.194612601903529, 68.08032183380071, 66.798157762575116, 67.365659235857947, 66.057978759493494, 68.206968502343145, 67.726013188486789, 67.084519455620253, 68.286305110851927, 67.308746343310716, 67.730977529700141, 67.453420632556259, 67.875837918953451, 67.407384432811227, 66.635613757908857, 67.612584413021906, 67.736453761170765, 67.053853576326887] + traf24 = [68.053253739111483, 66.723170827688392, 66.986436216240961, 70.371690621742587, 69.591811241936725, 68.630188417956361, 68.996940007996557, 69.465195416297902, 69.705929949780909, 69.651586626408388, 69.442491044882061, 70.257725914898174, 70.567677595266488, 70.673712605152971, 69.738912354219408, 70.069263000844302, 69.545309329169896, 69.424420469501044, 68.603485359875464, 69.386705722777279, 69.500510303099901] + t = np.mean(np.abs(np.array(occ24)-np.array(traf24))/np.array(occ24)) + diff.append(t) + diff = np.dot(diff,100) + print diff + print np.mean(diff) + time = [] - traf= [] - occ = [] - ha = [] - for time10 in range(160,240,10): - time01 = time10 / 10.0 - + for time10 in range(160,241,10): + time01 = time10 / 10.0 for i in range(len(time1)): if time1[i] == time01: - if time1[i] == 21: - print (traf1[i]-occ1[i])/traf1[i] time.append(time1[i]) - traf.append(traf1[i]) - occ.append(occ1[i]) - ha.append(ha1[i]) break - - time.append(time1[-1]) - traf.append(traf1[-1]) - occ.append(occ1[-1]) - ha.append(ha[-1]) - print 'MEAN - occ p: ',np.mean(occ) - print 'MEAN - occ t:', np.mean(traf) - print 'MEAN - traf t:', np.mean(ha) - #xlim(20, 22) - #ylim(0,20) + ylim(-0,10) fig = plt.figure(1) errorDis1 = plt.subplot(1,1,1) ax=plt.gca() @@ -1434,13 +2273,14 @@ def AutoLocatorInit(self): for tick in ax.yaxis.get_major_ticks(): tick.label1.set_fontsize(40) errorDis1.set_xlabel('Time',size=50) - errorDis1.set_ylabel('MSE',size=50) - errorDis1.plot(time,ha,'.b--',label='TF-T', linewidth=2.5, markersize=60,markerfacecolor='b',markeredgecolor='b') - errorDis1.plot(time,occ,'*r--',label='TFO-P', linewidth=2.5, markersize=40,markerfacecolor='r',markeredgecolor='r') - errorDis1.plot(time,traf,'sk-',label='TFO-T', linewidth = 2.5, markersize=30,markerfacecolor='k',markeredgecolor='k') + errorDis1.set_ylabel('Mean Percentage (%)',size=50) + #errorDis1.plot(time,occ,'*r--',label='TPO-P', linewidth=2.5, markersize=40,markerfacecolor='r',markeredgecolor='r') + print len(time),len(diff) + errorDis1.plot(time,diff,'sk-',label='TPO-T - TPO-P| / TPO-P', linewidth = 2.5, markersize=30,markerfacecolor='k',markeredgecolor='k') errorDis1.legend(bbox_to_anchor=(1, 1), prop={'size':40}) + plt.grid(True, linewidth = 3) plt.show() -#elif graph == 34:#Lin Cheung - TFO-TT VS TF-T, 1 months training, 1 months testing +#elif graph == 34:#Lin Cheung - TPO-TT VS TP-T, 1 months training, 1 months testing # time1 = [ 16.0 , 16.1 , 16.2 , 16.3 , 16.4 , 16.5 , 16.6 , 16.7 , 16.8 , 16.9 , 17.0 , 17.1 , 17.2 , 17.3 , 17.4 , 17.5 , 17.6 , 17.7 , 17.8 , 17.9 , 18.0 , 18.1 , 18.2 , 18.3 , 18.4 , 18.5 , 18.6 , 18.7 , 18.8 , 18.9 , 19.0 , 19.1 , 19.2 , 19.3 , 19.4 , 19.5 , 19.6 , 19.7 , 19.8 , 19.9 , 20.0 , 20.1 , 20.2 , 20.3 , 20.4 , 20.5 , 20.6 , 20.7 , 20.8 , 20.9 , 21.0 , 21.1 , 21.2 , 21.3 , 21.4 , 21.5 , 21.6 , 21.7 , 21.8 , 21.9 , 22.0 , 22.1 , 22.2 , 22.3 , 22.4 , 22.5 , 22.6 , 22.7 , 22.8 , 22.9 , 23.0 , 23.1 , 23.2 , 23.3 , 23.4 , 23.5 , 23.6 , 23.7 , 23.8 , 23.9 , 24.0 ] # occ1 = [ 5.57239074764 , 3.94463027271 , 9.82187627072 , 17.6637747418 , 12.8078583137 , 4.98896303131 , 1.26044276869 , 0.761849528199 , 1.47718154615 , 1.99213178602 , 0.355741634508 , 0.442311675517 , 0.201809214452 , 0.365020546082 , 1.86369509938 , 1.21801716357 , 17.3881640899 , 10.0320657159 , 1.19726139889 , 0.571420452441 , 4.18142674465 , 4.31058266454 , 4.78018596297 , 3.28576012223 , 5.85050167165 , 2.70739575173 , 0.421337122472 , 0.496463139899 , 3.28355012424 , 5.34929069964 , 1.23804118318 , 5.1420406618 , 2.29927835034 , 16.6873265139 , 16.435394319 , 0.376377976438 , 2.72118541206 , 1.47441761914 , 1.34107164574 , 1.61090260254 , 8.87085478669 , 17.7458935979 , 27.6341018413 , 2.14146348178 , 1.13110076716 , 4.08295899489 , 0.65407135873 , 3.97976284942 , 3.14643530165 , 1.98292621383 , 4.61209657007 , 0.748269981314 , 1.58598371097 , 0.77671194209 , 0.285708092695 , 0.437693416825 , 0.925092915916 , 0.31978273665 , 0.403664081267 , 0.532834639837 , 0.4830288381 , 0.918549790777 , 0.761965852527 , 0.754987466884 , 0.439885758927 , 0.675604906839 , 0.835107677073 , 1.18418686689 , 0.84401725515 , 4.88466318727 , 7.63040683748 , 29.0859820268 , 22.6893571698 , 0.442177546547 , 0.523817661237 , 0.650807723773 , 0.340159154395 , 0.304019809615 , 0.426296869885 , 0.42629119812 , 0.426278103343 ] # traf1 = [ 5.89444444444 , 3.18777777778 , 7.46333333333 , 12.2277777778 , 10.2844444444 , 5.73333333333 , 2.99111111111 , 2.57888888889 , 1.78666666667 , 2.32666666667 , 1.96 , 3.97 , 2.43666666667 , 1.53333333333 , 1.89 , 3.62222222222 , 12.4722222222 , 8.70666666667 , 1.69333333333 , 1.95555555556 , 5.05 , 6.12 , 4.72222222222 , 3.77 , 4.95777777778 , 2.05555555556 , 0.568888888889 , 1.67777777778 , 3.78333333333 , 5.91666666667 , 4.59666666667 , 4.94666666667 , 3.41333333333 , 12.1044444444 , 13.5255555556 , 1.02444444444 , 2.25555555556 , 2.05888888889 , 2.31555555556 , 4.59666666667 , 11.9833333333 , 19.9788888889 , 25.1888888889 , 10.6177777778 , 19.3833333333 , 15.0088888889 , 15.6722222222 , 13.2555555556 , 16.0633333333 , 17.7844444444 , 20.9 , 14.3088888889 , 18.3566666667 , 10.78 , 4.71666666667 , 0.507777777778 , 0.907777777778 , 0.5 , 0.393333333333 , 0.724444444444 , 0.57 , 0.822222222222 , 0.903333333333 , 0.822222222222 , 0.57 , 0.726666666667 , 0.713333333333 , 0.762222222222 , 0.866666666667 , 3.43666666667 , 6.21888888889 , 20.6988888889 , 16.4911111111 , 0.646666666667 , 0.506666666667 , 0.613333333333 , 0.374444444444 , 0.343333333333 , 0.432222222222 , 0.432222222222 , 0.432222222222 ] @@ -1476,34 +2316,60 @@ def AutoLocatorInit(self): # tick.label1.set_fontsize(40) # errorDis1.set_xlabel('Time',size=50) # errorDis1.set_ylabel('MSE',size=50) -# errorDis1.plot(time,occ,'sk-',label='TFO-TT', linewidth=2.5, markersize=30,markerfacecolor='k',markeredgecolor='k') -# errorDis1.plot(time,traf,'*r--',label='TF-T', linewidth = 2.5, markersize=40,markerfacecolor='r',markeredgecolor='r') +# errorDis1.plot(time,occ,'sk-',label='TPO-TT', linewidth=2.5, markersize=30,markerfacecolor='k',markeredgecolor='k') +# errorDis1.plot(time,traf,'*r--',label='TP-T', linewidth = 2.5, markersize=40,markerfacecolor='r',markeredgecolor='r') # errorDis1.legend(bbox_to_anchor=(1, 1), prop={'size':40}) # plt.show() -elif graph == 35:#TF-T div TFO-T - time = [] - time = [16, 17, 18, 19, 20, 21, 22, 23, 24] - zero = [0,0,0,0,0,0,0,0,0] - #20% - ratio = [0.9226968260940509, 2.3299636296757691, 6.1308679657051401, 3.3373095525097929, 1.8801378014210286, 5.0544597175498813, 28.441763144349881, 1.3896783132826964, 1.1369982372732155] - #print len(ha) - print 'Ratio', np.mean(ratio) - #print 'Real', np.mean(ha) +elif graph == 35.3:#Lin Cheung - TPO-T VS TP-P +#TPO-T v.s. TP-P: MSE as a function of time. + time1 = [ 16.0 , 16.1 , 16.2 , 16.3 , 16.4 , 16.5 , 16.6 , 16.7 , 16.8 , 16.9 , 17.0 , 17.1 , 17.2 , 17.3 , 17.4 , 17.5 , 17.6 , 17.7 , 17.8 , 17.9 , 18.0 , 18.1 , 18.2 , 18.3 , 18.4 , 18.5 , 18.6 , 18.7 , 18.8 , 18.9 , 19.0 , 19.1 , 19.2 , 19.3 , 19.4 , 19.5 , 19.6 , 19.7 , 19.8 , 19.9 , 20.0 , 20.1 , 20.2 , 20.3 , 20.4 , 20.5 , 20.6 , 20.7 , 20.8 , 20.9 , 21.0 , 21.1 , 21.2 , 21.3 , 21.4 , 21.5 , 21.6 , 21.7 , 21.8 , 21.9 , 22.0 , 22.1 , 22.2 , 22.3 , 22.4 , 22.5 , 22.6 , 22.7 , 22.8 , 22.9 , 23.0 , 23.1 , 23.2 , 23.3 , 23.4 , 23.5 , 23.6 , 23.7 , 23.8 , 23.9 , 24.0 ] + traf1 = [ 5.67034912902 , 3.4439361993 , 7.41826198014 , 12.2542358573 , 9.28203790162 , 5.86881015359 , 2.74121015261 , 2.43203836572 , 1.56769559353 , 2.29906347435 , 2.19519642645 , 3.76270787453 , 2.60791922839 , 1.93977440675 , 2.22490763293 , 2.1285169511 , 12.0268924432 , 8.75495020281 , 1.51164982502 , 1.7262822417 , 3.69702882167 , 5.17441326713 , 3.91906176782 , 3.24130229581 , 4.36181903615 , 2.06036518521 , 0.863133464832 , 1.88208246395 , 3.79041757886 , 6.08279658256 , 4.64154595031 , 5.09382003718 , 3.59051814473 , 11.7662128781 , 13.3825697739 , 1.04480363183 , 1.75460440286 , 1.92492904929 , 2.35518835321 , 4.39700066378 , 10.5874467744 , 19.0551710251 , 22.02362077 , 10.7710691987 , 25.3702078592 , 13.8407086908 , 11.7838011769 , 9.45152399524 , 7.67663240032 , 3.53185195857 , 6.26581398446 , 10.2999464928 , 27.4767195669 , 1.20030632239 , 1.06412381931 , 0.75215874301 , 0.797127220553 , 0.418335430494 , 0.387485269692 , 0.746547344465 , 2.30934764997 , 1.13401107389 , 1.18226625051 , 2.4639587413 , 1.03275962596 , 1.04058915034 , 1.02561195806 , 0.717555965534 , 0.752406516688 , 3.35712889926 , 6.13955660405 , 20.7402572695 , 16.4197585943 , 0.647778847426 , 0.500274852399 , 0.612234609617 , 0.396466438523 , 0.328438554444 , 0.458621687999 , 0.457650006252 , 0.781134210783 ] + occ1 = [ 5.57239074764 , 3.94463027271 , 9.82187627072 , 17.6637747418 , 12.8078583137 , 4.98896303131 , 1.26044276869 , 0.761849528199 , 1.47718154615 , 1.99213178602 , 0.355741634508 , 0.442311675517 , 0.201809214452 , 0.365020546082 , 1.86369509938 , 1.21801716357 , 17.3881640899 , 10.0320657159 , 1.19726139889 , 0.571420452441 , 4.18142674465 , 4.31058266454 , 4.78018596297 , 3.28576012223 , 5.85050167165 , 2.70739575173 , 0.421337122472 , 0.496463139899 , 3.28355012424 , 5.34929069964 , 1.23804118318 , 5.1420406618 , 2.29927835034 , 16.6873265139 , 16.435394319 , 0.376377976438 , 2.72118541206 , 1.47441761914 , 1.34107164574 , 1.61090260254 , 8.87085478669 , 17.7458935979 , 27.6341018413 , 2.14146348178 , 1.13110076716 , 4.08295899489 , 0.65407135873 , 3.97976284942 , 3.14643530165 , 1.98292621383 , 4.61209657007 , 0.748269981314 , 1.58598371097 , 0.77671194209 , 0.285708092695 , 0.437693416825 , 0.925092915916 , 0.31978273665 , 0.403664081267 , 0.532834639837 , 0.4830288381 , 0.918549790777 , 0.761965852527 , 0.754987466884 , 0.439885758927 , 0.675604906839 , 0.835107677073 , 1.18418686689 , 0.84401725515 , 4.88466318727 , 7.63040683748 , 29.0859820268 , 22.6893571698 , 0.442177546547 , 0.523817661237 , 0.650807723773 , 0.340159154395 , 0.304019809615 , 0.426296869885 , 0.42629119812 , 0.426278103343 ] + ha1 = [ 5.89444444444 , 3.18777777778 , 7.46333333333 , 12.2277777778 , 10.2844444444 , 5.73333333333 , 2.99111111111 , 2.57888888889 , 1.78666666667 , 2.32666666667 , 1.96 , 3.97 , 2.43666666667 , 1.53333333333 , 1.89 , 3.62222222222 , 12.4722222222 , 8.70666666667 , 1.69333333333 , 1.95555555556 , 5.05 , 6.12 , 4.72222222222 , 3.77 , 4.95777777778 , 2.05555555556 , 0.568888888889 , 1.67777777778 , 3.78333333333 , 5.91666666667 , 4.59666666667 , 4.94666666667 , 3.41333333333 , 12.1044444444 , 13.5255555556 , 1.02444444444 , 2.25555555556 , 2.05888888889 , 2.31555555556 , 4.59666666667 , 11.9833333333 , 19.9788888889 , 25.1888888889 , 10.6177777778 , 19.3833333333 , 15.0088888889 , 15.6722222222 , 13.2555555556 , 16.0633333333 , 17.7844444444 , 20.9 , 14.3088888889 , 18.3566666667 , 10.78 , 4.71666666667 , 0.507777777778 , 0.907777777778 , 0.5 , 0.393333333333 , 0.724444444444 , 0.57 , 0.822222222222 , 0.903333333333 , 0.822222222222 , 0.57 , 0.726666666667 , 0.713333333333 , 0.762222222222 , 0.866666666667 , 3.43666666667 , 6.21888888889 , 20.6988888889 , 16.4911111111 , 0.646666666667 , 0.506666666667 , 0.613333333333 , 0.374444444444 , 0.343333333333 , 0.432222222222 , 0.432222222222 , 0.432222222222 ] + + time = [] + traf= [] + occ = [] + ha = [] + for time10 in range(160,240,10): + time01 = time10 / 10.0 + + for i in range(len(time1)): + if time1[i] == time01: + if time1[i] == 21: + print (traf1[i]-occ1[i])/traf1[i] + time.append(time1[i]) + traf.append(traf1[i]) + occ.append(occ1[i]) + ha.append(ha1[i]) + break + + time.append(time1[-1]) + traf.append(traf1[-1]) + occ.append(occ1[-1]) + ha.append(ha[-1]) + print 'MEAN - occ p: ',np.mean(occ) + print 'MEAN - occ t:', np.mean(traf) + #print 'MEAN - traf t:', np.mean(ha) + + #xlim(20, 22) + ylim(0,12) fig = plt.figure(1) errorDis1 = plt.subplot(1,1,1) ax=plt.gca() for tick in ax.xaxis.get_major_ticks(): - tick.label1.set_fontsize(40) + tick.label1.set_fontsize(xfontsize) for tick in ax.yaxis.get_major_ticks(): - tick.label1.set_fontsize(40) - errorDis1.set_xlabel('Time',size=50) - errorDis1.set_ylabel('Mean Ratio',size=50) - errorDis1.plot(time,zero,'r--', linewidth=2.5, markersize=6,markerfacecolor='r',markeredgecolor='r') - errorDis1.plot(time,ratio,'sk-',label='TF-T / TFO-T', linewidth = 2.5, markersize=30,markerfacecolor='k',markeredgecolor='k') - ylim(-1.1,30) - errorDis1.legend(bbox_to_anchor=(0.5, 1), loc=0, borderaxespad=0.,prop={'size':40}) + tick.label1.set_fontsize(yfontsize) + errorDis1.set_xlabel('Time',size=xlabelsize) + errorDis1.set_ylabel('MSE',size=ylabelsize) + #errorDis1.plot(time,ha,'.b--',label='TP-T', linewidth=2.5, markersize=60,markerfacecolor='b',markeredgecolor='b') + errorDis1.plot(time,traf,'*r--',label='TP-P', linewidth=lwidth, markersize=starsize,markerfacecolor='none',markeredgecolor='r',markeredgewidth=mewidth) + errorDis1.plot(time,occ,'pb-',label='TPO-T', linewidth = lwidth, markersize=psize,markerfacecolor='none',markeredgecolor='b',markeredgewidth=mewidth) + errorDis1.legend(bbox_to_anchor=(1, 1), prop={'size':legendsize}) + plt.grid(True, linewidth = lwidth) plt.show() -elif graph == 36:#TF-P div TFO-PT +elif graph == 36:#TP-P div TPO-PT time = [] time = [16, 17, 18, 19, 20, 21, 22, 23, 24] #4% @@ -1523,12 +2389,12 @@ def AutoLocatorInit(self): errorDis1.set_xlabel('Time',size=50) errorDis1.set_ylabel('Mean Ratio of MSE',size=50) #errorDis1.plot(time,ha,'*r--',label='Real', linewidth=2.5, markersize=6,markerfacecolor='r',markeredgecolor='r') - errorDis1.plot(time,ratio,'sk-',label='TF-P / TFO-P', linewidth = 2.5, markersize=30,markerfacecolor='k',markeredgecolor='k') + errorDis1.plot(time,ratio,'sk-',label='TP-P / TPO-P', linewidth = 2.5, markersize=30,markerfacecolor='k',markeredgecolor='k') errorDis1.plot(time,zero,'r--', linewidth = 2.5, markersize=40,markerfacecolor='r',markeredgecolor='r') errorDis1.legend(bbox_to_anchor=(0.5, 1), loc=0, borderaxespad=0.,prop={'size':40}) plt.show() -elif graph == 37:#48hour TFO-PT VS TF-T +elif graph == 37:#48hour TPO-PT VS TP-T time1 = [ 16.0 , 16.1 , 16.2 , 16.3 , 16.4 , 16.5 , 16.6 , 16.7 , 16.8 , 16.9 , 17.0 , 17.1 , 17.2 , 17.3 , 17.4 , 17.5 , 17.6 , 17.7 , 17.8 , 17.9 , 18.0 , 18.1 , 18.2 , 18.3 , 18.4 , 18.5 , 18.6 , 18.7 , 18.8 , 18.9 , 19.0 , 19.1 , 19.2 , 19.3 , 19.4 , 19.5 , 19.6 , 19.7 , 19.8 , 19.9 , 20.0 , 20.1 , 20.2 , 20.3 , 20.4 , 20.5 , 20.6 , 20.7 , 20.8 , 20.9 , 21.0 , 21.1 , 21.2 , 21.3 , 21.4 , 21.5 , 21.6 , 21.7 , 21.8 , 21.9 , 22.0 , 22.1 , 22.2 , 22.3 , 22.4 , 22.5 , 22.6 , 22.7 , 22.8 , 22.9 , 23.0 , 23.1 , 23.2 , 23.3 , 23.4 , 23.5 , 23.6 , 23.7 , 23.8 , 23.9 , 24.0 ] occ1 = [0.72780764727918612, 2.4295521007800382, 0.70234346540399994, 1.5486264946582398, 6.0782948643337997, 0.77434926310172003, 3.719228561677915, 2.8951147057969999, 0.96883608269807397, 5.5201297904137991, 0.71076229265208002, 1.4562770801029419, 0.84815015397507998, 0.85910023422352, 0.24740998175358797, 3.2142055581427997, 0.69147734056672006, 2.2394500980571999, 0.76603102995109573, 4.9520418537813171, 0.35132204978722203, 0.88765105692089996, 2.7740318243982864, 0.98516538477019999, 4.6178400357402394, 0.86588920014928006, 1.1488896588206192, 0.36775475404015806, 1.4138401150024762, 0.72543074907338001, 2.2058094467158997, 1.4399810307964001, 0.54872465710308893, 3.4354518281233397, 3.3895444974739442, 1.8161727844377999, 3.1935171562568399, 3.4901521267436202, 3.4059027723811801, 4.9678982633159201, 2.6181845639446784, 1.2039198204134001, 0.6863694194194, 1.4666582330069999, 6.0459171245027994, 1.9164696335396401, 2.9688575130161658, 3.9846676812353805, 0.64867544231354002, 2.3449271907520002, 5.6746411164578001, 3.9416981961145225, 3.6014173753566445, 7.1032653598091402, 3.8815308465678, 2.225184118204, 6.5251878801517194, 1.9086011683364998, 4.9388811933778261, 1.7392007155273201, 3.374247126934776, 8.7425309983386406, 4.6822780866958, 5.2627875701080002, 4.8849803609853009, 4.0490141709755996, 1.1814561186882, 6.4831952080468609, 6.9383215592628176, 1.4583135193540999, 3.4548060753535403, 4.0792900629364599, 4.9721026522263596, 1.5992867901165879, 2.7548883273223801, 0.95688659932263997, 2.7917691010901997, 7.3108532841832004, 3.2878203286152123, 3.2122278466173002, 2.8080033137076525] traf1 = [0.61535283220987202, 1.7847186481294919, 1.44968359381182, 1.8056290111211399, 5.3709052159879009, 1.1436525612628399, 4.2211614361442003, 2.6885327466035998, 1.1887537893917599, 6.8639953505503399, 2.39348572346, 3.0279546032917999, 0.31010507600657999, 1.1810336341970999, 0.62283357114993998, 3.9584450447817998, 0.83558153031402793, 1.6425427335377201, 1.4252912967137998, 6.4468285393834011, 0.55887822990960001, 0.9831046066393283, 2.8170388014452241, 1.1097274293167096, 5.3798287665132003, 0.28355137302514, 3.9590833630425797, 0.51983960653502004, 3.0912595879229103, 1.57544995785848, 1.9331612889222001, 1.7034181539529805, 0.7607500769590001, 5.6863725150229616, 3.0132172926278002, 2.2350284140227918, 2.6605313847548198, 3.2676198846527997, 3.0023581682031519, 5.3517830960434418, 2.5312568993596996, 0.30571578453274001, 0.78511374072934825, 1.43918404620532, 7.2178322638818333, 2.1120183197596001, 2.94877567885294, 4.3433114907764807, 1.7781518182152438, 4.5772780531147799, 4.8542536372446001, 9.0223091407689591, 2.5546494363813999, 10.640743180714001, 3.9064563221294, 3.7732072546529793, 7.9969015805262798, 2.8175719966082, 4.9551065904418197, 0.90383635694895437, 5.2039550559338004, 5.9390267215114001, 3.3506787608040001, 4.6933690950609002, 4.4100597103839458, 4.7471922763557997, 1.1943962105932002, 2.1493054316050402, 6.6487012589879813, 1.2622156764218599, 6.7214295562008006, 6.5220170792840007, 4.1264045154000204, 8.1829305394761995, 2.5190561369628801, 1.5955913698844157, 1.4595247111620202, 7.6986985805166004, 5.5854302543521994, 5.9945111450464008, 4.51534271015906] @@ -1562,58 +2428,79 @@ def AutoLocatorInit(self): tick.label1.set_fontsize(40) errorDis1.set_xlabel('Time',size=50) errorDis1.set_ylabel('MSE',size=50) - errorDis1.plot(time,occ,'sk-',label='TFO-P', linewidth=2.5, markersize=30,markerfacecolor='k',markeredgecolor='k') - errorDis1.plot(time,traf,'*r--',label='TF-P', linewidth = 2.5, markersize=40,markerfacecolor='r',markeredgecolor='r') + errorDis1.plot(time,occ,'sk-',label='TPO-P', linewidth=2.5, markersize=30,markerfacecolor='k',markeredgecolor='k') + errorDis1.plot(time,traf,'*r--',label='TP-T', linewidth = 2.5, markersize=40,markerfacecolor='r',markeredgecolor='r') errorDis1.legend(bbox_to_anchor=(0.3, 1), prop={'size':40}) plt.show() -#errorDis1.set_xlabel('No. of experiments',size=45) -#errorDis1.plot(time,ha,'r--',label='history traf MSE') -#errorDis1.plot(time,ha2,'b--',label='history traf_only MSE(half)') -#errorDis1.legend(bbox_to_anchor=(0, 1), loc=0, borderaxespad=0.,prop={'size':37}) - #errorDis1.plot(area,corrWd,'r--',label='corr rand in weekday') - #errorDis1.plot(area,corr,'k',label='corr rand') - #errorDis1.plot(area,corrWk,'b--',label='corr rand in weekend') - #errorDis1.plot(AveDis,AccDelta,'r',label='dis vs acc') - #errorDis1.plot(AveCorr,AccDelta,'r',label='corr vs acc') - - -#errorDis1.plot(time,occlwrAcc,'b--',label='occ_only') -#errorDis1.plot(day,lwrAcc,'r--',label='traf_only') -#errorDis1.plot(day,occlwrAcc,'b--',label='occ_only') -#errorDis1.plot(day,occtraflwrAcc,'k--',label='combined ori') -#errorDis1.plot(day,lwrAcc2,'r',label='traf_only') -#errorDis1.plot(day,occlwrAcc2,'b',label='occ_only') -#errorDis1.plot(day,occtraflwrAcc2,'k',label='combined cut') -#errorDis1.plot(date,sublearn,'k--',label='sublearn') -#errorDis1.plot(date,s181,label='s181') -#errorDis1.plot(date,s251,label='s251') -#errorDis1.plot(date,s461,label='s461') -#errorDis1.plot(date,s471,label='s471') -#errorDis1.plot(date,learn,'b',label='learn') -#errorDis1.plot(date,previous,'r',label='previous') -#errorDis1.plot(cor,S23error,'',label='s23error') - -#errorDis1.legend(bbox_to_anchor=(1, 1), loc=0, borderaxespad=0.,prop={'size':17}) +elif graph == 38:#percentage vs mse +#TPO-T: MSE as a function of forecasting percentage + per = [52.38095238095238, 57.14285714285714, 66.66666666666666, 71.42857142857143, 80.95238095238095, 85.71428571428571, 90.47619047619048, 90.47619047619048, 95.23809523809523, 100] + mse = [14.432190765548022, 10.59450013363959, 6.3412289417423962, 6.9643339025877538, 3.9622087458591357, 4.4781589470401437, 3.0448721519651856, 2.9122297591063191, 2.1049377964670275, 0.88895257467516176] + fig = plt.figure(1) + errorDis1 = plt.subplot(1,1,1) + ax=plt.gca() + for tick in ax.xaxis.get_major_ticks(): + tick.label1.set_fontsize(40) + for tick in ax.yaxis.get_major_ticks(): + tick.label1.set_fontsize(40) + errorDis1.set_xlabel('Forecasting Percentage (%)',size=50) + errorDis1.set_ylabel('Mean MSE',size=50) + errorDis1.plot(per,mse,'sk-',label='TPO-T', linewidth = 2.5, markersize=30,markerfacecolor='k',markeredgecolor='k') + ylim(-1,15.2) + xlim(49,103) + errorDis1.legend(bbox_to_anchor=(0.5, 1), loc=0, borderaxespad=0.,prop={'size':40}) + plt.grid(True, linewidth = 3) +elif graph == 40:#TPO-T training 4 weeks (also have 2 weeks, 6 weeks data) - decaying +# + leng = [1, 2, 3, 4, 5, 6] + #mse2 = [3.67713863081, 5.06974272889, 6.224175929, 6.02550862605,8.05669732638,8.58409540757] + mse4 = [2.67441462179, 3.95126933408, 5.01872380244, 4.76410201339, 6.60237428115, 6.88553217152]#, None + #mse6 = [4.12921535382, 3.94573492156, 5.65736878181, 5.73404829629, None, None] + fig = plt.figure(1) + errorDis1 = plt.subplot(1,1,1) + ax=plt.gca() + for tick in ax.xaxis.get_major_ticks(): + tick.label1.set_fontsize(40) + for tick in ax.yaxis.get_major_ticks(): + tick.label1.set_fontsize(40) + ax.set_xticks(np.linspace(1,6,6)) + ax.set_xticklabels( ('1-2','3-4', '5-6', '7-8', '9-10', '11-12')) #, '13-14' + errorDis1.set_xlabel('Prediction Period (weeks)',size=50) + errorDis1.set_ylabel('Mean MSE',size=50) + #errorDis1.plot(leng,mse2,'sk-',label='TPO-T 2', linewidth = 2.5, markersize=30,markerfacecolor='k',markeredgecolor='k') + errorDis1.plot(leng,mse4,'*r-',label='TPO-T', linewidth = 2.5, markersize=40,markerfacecolor='r',markeredgecolor='r') + #errorDis1.plot(leng,mse6,'ob-',label='TPO-T 6', linewidth = 2.5, markersize=30,markerfacecolor='b',markeredgecolor='b') + ylim(0,10) + #xlim(1, 12) + errorDis1.legend(bbox_to_anchor=(0.5, 1), loc=0, borderaxespad=0.,prop={'size':40}) + plt.grid(True, linewidth = 3) +elif graph == 41:#TPO-T training 2 weeks and retrain - decaying +# + leng = [1, 2, 3, 4, 5, 6] + mse2 = [3.67713863081, 5.06974272889, 6.224175929, 6.02550862605,8.05669732638,8.58409540757] + mse2r = [3.67713863081, 5.06974272889, 6.224175929, 6.02550862605,6.99805786152,7.72584682572] + fig = plt.figure(1) + errorDis1 = plt.subplot(1,1,1) + ax=plt.gca() + for tick in ax.xaxis.get_major_ticks(): + tick.label1.set_fontsize(40) + for tick in ax.yaxis.get_major_ticks(): + tick.label1.set_fontsize(40) + ax.set_xticks(np.linspace(1,6,6)) + ax.set_xticklabels( ('3-4', '5-6', '7-8', '9-10', '11-12', '12-14')) + errorDis1.set_xlabel('Prediction Period (weeks)',size=50) + errorDis1.set_ylabel('Mean MSE',size=50) + errorDis1.plot(leng,mse2,'sk-',label='TPO-T 2', linewidth = 2.5, markersize=30,markerfacecolor='k',markeredgecolor='k') + errorDis1.plot(leng,mse2r,'*r-',label='TPO-T 2 retrain', linewidth = 2.5, markersize=40,markerfacecolor='r',markeredgecolor='r') + #errorDis1.plot(leng,mse6,'ob-',label='TPO-T 6', linewidth = 2.5, markersize=30,markerfacecolor='b',markeredgecolor='b') + ylim(0,10) + #xlim(1, 12) + errorDis1.legend(bbox_to_anchor=(0.5, 1), loc=0, borderaxespad=0.,prop={'size':40}) + plt.grid(True, linewidth = 3) -#cor = [0.5734, 0.7675, 0.8643] -# -#ourError = [1-0.148752743511, 1-0.0601731570798, 1-0.0302768413546] -#haError = [1-0.18983514058,1-0.0491933331101,1-0.0324118254366] -#rwError = [1-0.254860392664,1-0.060109612444,1-0.0333451868058] -# -##offset = [0.555493464052, 1.51768300654] -# -#fig = plt.figure(1) -#errorDis1 = plt.subplot(1,1,1) -#errorDis1.plot(cor,ourError,'k--',label='ourError') -#errorDis1.plot(cor,haError,'b',label='haError') -#errorDis1.plot(cor,rwError,'r',label='rwError') -##errorDis1.plot(cor,S23error,'',label='s23error') -#errorDis1.set_xlabel('Correlation') -#errorDis1.set_ylabel('Accuracy (0-1)') -#errorDis1.legend(bbox_to_anchor=(1.05, 1), loc=2, borderaxespad=0.,prop={'size':8}) -#plt.show() \ No newline at end of file + + \ No newline at end of file diff --git a/plotPiechart.py b/plotPiechart.py index d700860..0b5d400 100644 --- a/plotPiechart.py +++ b/plotPiechart.py @@ -7,7 +7,7 @@ import matplotlib.pyplot as plt -chart = 2 +chart = 4 if chart == 0: # The slices will be ordered and plotted counter-clockwise. @@ -55,4 +55,38 @@ plt.rcParams['font.size'] = 50 #print plt.rcParams.keys() #if you do not know what parameters will work + plt.show() +elif chart == 3:#Probabilities - the exact number of group that a zone is contained in (totally 8 groups). + # The slices will be ordered and plotted counter-clockwise. + labels = 'Only 1 group', '2 groups', '3 groups', '4 groups', '5 groups' + sizes = [15.625,31.25,31.25,15.625,6.25] + colors = ['grey','yellowgreen','orange','yellow','pink'] + explode = (0.3, 0,0,0,0) # only "explode" the 1st slice + + plt.pie(sizes, explode=explode, labels=labels, colors=colors, + autopct='%1.2f%%', shadow=True, startangle=-80) + # Set aspect ratio to be equal so that pie is drawn as a circle. + plt.axis('equal') + #plt.title('The exact number of group that layers are contained in') + plt.rcParams['axes.labelsize'] = 50 + plt.rcParams['font.size'] = 50 + #print plt.rcParams.keys() #if you do not know what parameters will work + + plt.show() +elif chart == 4: + # The slices will be ordered and plotted counter-clockwise. + labels = 'Not overlap', 'Overlap' + sizes = [15.625, 84.375] + colors = ['grey','orange'] + explode = (0.3, 0) # only "explode" the 1st slice + + plt.pie(sizes, explode=explode, labels=labels, colors=colors, + autopct='%1.2f%%', shadow=True, startangle=-80) + # Set aspect ratio to be equal so that pie is drawn as a circle. + plt.axis('equal') + + plt.rcParams['axes.labelsize'] = 50 + plt.rcParams['font.size'] = 50 + #print plt.rcParams.keys() #if you do not know what parameters will work + plt.show() \ No newline at end of file