/polo

A Markov chain implementation in Go.

Primary LanguageGoMIT LicenseMIT

polo

A Markov chain implementation in Go.

image

➜ polo git:(master) ✗ go run .
P(Sunny|Sunny) = 0.80
P(Rainy|Sunny) = 0.05
P(Cloudy|Sunny) = 0.15

P(Sunny|Rainy) = 0.20
P(Rainy|Rainy) = 0.60
P(Cloudy|Rainy) = 0.20

P(Sunny|Cloudy) = 0.20
P(Rainy|Cloudy) = 0.30
P(Cloudy|Cloudy) = 0.50


The probability of tomorrow being Sunny, given that today was Rainy is 0.2

The next state, given that today was Sunny is Sunny

TODO

  • Basic Markov Chain
  • Fix Chain.Next()
  • Implement cumsum and implement better rand.Sample algorithm
  • Drawing/Visualizing a graph of chain with probabilities
  • Higher Order Chains

References