// sampled.loc[0] = [self.state[var] for var in self.variables]
for i in range(size):
for var in self.variables:
val = self.state[var]
next_val = sample_discrete(list(self.transition_models[var][val].keys()),
list(self.transition_models[var][val].values()))[0]
self.state[var] = next_val
yield {var: self.state[var] for var in self.variables}
def random_state(self):
Generates a random state of the Markov Chain.
After Change
next_st = sample_discrete(list(self.transition_models[var][st].keys()),
list(self.transition_models[var][st].values()))[0]
self.state[j] = State(var, next_st)
yield self.state[:]
def random_state(self):
Generates a random state of the Markov Chain.