An open API service indexing awesome lists of open source software.

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

Awesome Lists containing this project

README

          

# polo

A Markov chain implementation in Go.

![image](https://user-images.githubusercontent.com/1344906/134421146-e336e747-0aa1-41f4-8749-4a1f6872b0a7.png)

```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

-
-
-