https://github.com/fr3fou/polo
markov chain implementation in go
https://github.com/fr3fou/polo
go golang hacktoberfest markov markov-chain
Last synced: 9 months ago
JSON representation
markov chain implementation in go
- Host: GitHub
- URL: https://github.com/fr3fou/polo
- Owner: fr3fou
- License: mit
- Created: 2020-09-07T11:47:21.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2022-06-24T13:29:03.000Z (about 4 years ago)
- Last Synced: 2025-04-19T20:44:03.204Z (over 1 year ago)
- Topics: go, golang, hacktoberfest, markov, markov-chain
- Language: Go
- Homepage:
- Size: 67.4 KB
- Stars: 11
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# polo
A Markov chain implementation in Go.

```bash
➜ 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
- [x] Basic Markov Chain
- [x] Fix `Chain.Next()`
- [x] Implement `cumsum` and implement better `rand.Sample` algorithm
- [x] Drawing/Visualizing a graph of chain with probabilities
- [x] Higher Order Chains
## References
-
-
-