Skip to content

Commit

Permalink
dealt with the indent style in util.py
Browse files Browse the repository at this point in the history
  • Loading branch information
jingzbu committed Dec 29, 2014
1 parent d55091a commit c4812ba
Show file tree
Hide file tree
Showing 2 changed files with 90 additions and 90 deletions.
146 changes: 73 additions & 73 deletions Results/test.eps

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 17 additions & 17 deletions util/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,45 +348,45 @@ def HoeffdingRuleMarkov(beta, G, H, W, FlowNum):

def ChainGen(N, beta):
# Get the initial distribution mu_0
mu_0 = mu_ini(N**2)
mu_0 = mu_ini(N**2)

# Get the original transition matrix Q
Q = probability_matrix_Q(N)
Q = probability_matrix_Q(N)

# Get the new transition matrix P
P = P_est(Q)
P = P_est(Q)

# Get the actual stationary distribution mu; 1 x (N**2)
PP = LA.matrix_power(P, 1000)
mu = PP[0, :]
PP = LA.matrix_power(P, 1000)
mu = PP[0, :]

# Get a sample path of the Markov chain with length n_1; this path is used to estimate the stationary distribution
n_1 = 1000 * N * N # the length of a sample path
x_1 = chain(mu_0, P, n_1)
n_1 = 1000 * N * N # the length of a sample path
x_1 = chain(mu_0, P, n_1)

# Get the estimated stationary distribution mu_1
mu_1 = mu_est(x_1, N)
mu_1 = mu_est(x_1, N)

# Get the estimate of Q
Q_1 = Q_est(mu_1)
Q_1 = Q_est(mu_1)

# Get the estimate of P
P_1 = P_est(Q_1)
P_1 = P_est(Q_1)

# Get the estimate of the gradient
G_1 = G_est(Q_1)
G_1 = G_est(Q_1)

# Get the estimate of the Hessian
H_1 = H_est(mu_1)
H_1 = H_est(mu_1)

# Get the estimate of the covariance matrix
Sigma_1 = Sigma_est(P_1, mu_1)
Sigma_1 = Sigma_est(P_1, mu_1)

# Get an estimated sample path of W
SampNum = 1000
W_1 = W_est(Sigma_1, SampNum)
SampNum = 1000
W_1 = W_est(Sigma_1, SampNum)

return mu_0, mu, mu_1, P, G_1, H_1, W_1
return mu_0, mu, mu_1, P, G_1, H_1, W_1

from ..Simulator.ThresCalc import ThresSanov, ThresActual, ThresWeakConv
def visualization(N, beta):
Expand Down Expand Up @@ -415,4 +415,4 @@ def visualization(N, beta):
pylab.xlim(2 * N * N - 2, 6 * N * N + 5)
pylab.ylim(0, 1)
savefig('./Results/test.eps')
plt.show()
plt.show()

0 comments on commit c4812ba

Please sign in to comment.