N=6 #number of points CVini=1 CVend=200 L=CVend-CVini #initial dimensions ######################################### P1=load_data_range(CV_file,N,CVini,CVend) print P1.shape print L rn=(random.randint(0, L)) print rn print P1 print '#####################' #call delrn P2=delrn(P1,rn) print P2 #get the error E=getE(P1,P2) print E ############################### #### Monte Carlo EE=[] c=[] E1=1000000.0000 KT=0.01 L MC=100 #Monte Carlo iterations for i in range (MC): rn=(random.randint(0, L))
print L OI=[] dd=40 for i in range(dd,L): print i EF=[] deletedCVs=[] for i in range(L-1): if i==0: Plast=P1 #get maximal for j in range (i,L): Ptmp=delrn(Plast,j-i) Etmp=getE(P1,Ptmp) if j==i: maxE=Etmp max_index=i else: if Etmp>maxE: maxE=Etmp max_index=j EE=[] minE=maxE for j in range (i,L): PP=delrn(Plast,j-i) E=getE(P1,PP)