def _example(): from stars import Project s=Project("s") s.ReadData("csiss") income=s.getVariable("pcincome") ym=ClMarkov(income) ym.transMat s.ReadGalMatrix("states48") w=s.getMatrix("states48") sm=SpMarkov(income,w=w) return [ym,income.regionNames,sm]
def _example(): from stars import Project s = Project("s") s.ReadData("csiss") income = s.getVariable("pcincome") ym = ClMarkov(income) ym.transMat s.ReadGalMatrix("states48") w = s.getMatrix("states48") sm = SpMarkov(income, w=w) return [ym, income.regionNames, sm]
rowLabels = [ "Region %d"%i for i in range(n) ] columnLabels = [ str(i) for i in range(k) ] values = arange(nk) values = reshape(values,(n,k)) # get a master root=Tk() # create an instance #t=DataTable(root,values,name="Variable Name Here",rowLabels=rowLabels, # columnLabels=columnLabels,fmt=[8,0]) # from stars import Project from Markov import * s=Project('s') s.ReadData("data/csiss") y = s.getVariable('pcr') n,k = shape(y) #values=y #ijs = [ (i,j) for i in range(n) for j in range(k) ] #svalues = [ format([8,3], values[i,j]) for i,j in ijs ] s.ReadGalMatrix('states48') w=s.getMatrix('states48') sm = SpMarkov(y,w=w) classes = [ "%5.3f"% value for value in sm.upperBounds ] k=len(classes) rowLabels = [ c+" | "+r for r in classes for c in classes ] mat = sm.pMat mat = reshape(mat,(k*k,k)) st = DataTable(root,mat,rowLabels=rowLabels,
columnLabels = [str(i) for i in range(k)] values = arange(nk) values = reshape(values, (n, k)) # get a master root = Tk() # create an instance # t=DataTable(root,values,name="Variable Name Here",rowLabels=rowLabels, # columnLabels=columnLabels,fmt=[8,0]) # from stars import Project from Markov import * s = Project("s") s.ReadData("data/csiss") y = s.getVariable("pcr") n, k = shape(y) # values=y # ijs = [ (i,j) for i in range(n) for j in range(k) ] # svalues = [ format([8,3], values[i,j]) for i,j in ijs ] s.ReadGalMatrix("states48") w = s.getMatrix("states48") sm = SpMarkov(y, w=w) classes = ["%5.3f" % value for value in sm.upperBounds] k = len(classes) rowLabels = [c + " | " + r for r in classes for c in classes] mat = sm.pMat mat = reshape(mat, (k * k, k)) st = DataTable(