Пример #1
0
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]
Пример #2
0
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]
Пример #3
0
    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,
Пример #4
0
    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,
Пример #5
0
    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(