{"id":18015587,"url":"https://github.com/nomemory/markovneat","last_synced_at":"2025-03-26T18:31:19.527Z","repository":{"id":57736920,"uuid":"169047378","full_name":"nomemory/markovneat","owner":"nomemory","description":"Markov chains in Java","archived":false,"fork":false,"pushed_at":"2021-02-09T12:16:46.000Z","size":139,"stargazers_count":1,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-22T06:32:38.019Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nomemory.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-02-04T08:23:08.000Z","updated_at":"2023-02-01T08:28:51.000Z","dependencies_parsed_at":"2022-08-24T05:21:06.681Z","dependency_job_id":null,"html_url":"https://github.com/nomemory/markovneat","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nomemory%2Fmarkovneat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nomemory%2Fmarkovneat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nomemory%2Fmarkovneat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nomemory%2Fmarkovneat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nomemory","download_url":"https://codeload.github.com/nomemory/markovneat/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245712656,"owners_count":20660277,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-30T04:14:28.367Z","updated_at":"2025-03-26T18:31:19.251Z","avatar_url":"https://github.com/nomemory.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"[Markov chain](https://en.wikipedia.org/wiki/Markov_chain)s in Java.\n\n# Installing \n\nMaven:\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003enet.andreinc\u003c/groupId\u003e\n  \u003cartifactId\u003emarkovneat\u003c/artifactId\u003e\n  \u003cversion\u003e1.8\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nGradle:\n```groovy\nimplementation 'net.andreinc:markovneat:1.8'\n```\n\nYou can also create a \"fat\" jar using the `shadowJar` gradle tasks:\n\n```groovy\ngradle shadowJar\n```\n\nThe jar will be generated in `/build/libs/markovneat*.jar`.\n\n# Example 1 - Modelling a simple discrete-time markov chain\n\nA directed graph is used bellow to picture the state transitions for a Markov Chain. \n\nThe states represent whether a hypothetical stock market is exhibiting a bull market, bear market, or stagnant market trend during a given week.\n\n(See [Market trends](https://en.wikipedia.org/wiki/Market_trend)).\n\n![alt text](https://github.com/nomemory/markovneat/blob/master/media/example01.png)\n\nWith the **markovneat** library this can be modelled using the following code:\n\n```java\n MChain\u003cString\u003e marketMChain = new MChain\u003c\u003e();\n\n// Transitioning from \"BULL\" to \"BULL\" has a 90% chance\nmarketMChain.add(new MState\u003c\u003e(\"BULL\"), \"BULL\", 0.9);\n// Transitioning from \"BULL\" to \"BEAR\" has a 7,5% chance\nmarketMChain.add(new MState\u003c\u003e(\"BULL\"), \"BEAR\", 0.075);\n// Transitioning from \"BULL\" to \"STAGNANT\" has a 2,5% chance\nmarketMChain.add(new MState\u003c\u003e(\"BULL\"), \"STAGNANT\", 0.025);\n\nmarketMChain.add(new MState\u003c\u003e(\"BEAR\"), \"BEAR\", 0.8);\nmarketMChain.add(new MState\u003c\u003e(\"BEAR\"), \"BULL\", 0.15);\nmarketMChain.add(new MState\u003c\u003e(\"BEAR\"), \"STAGNANT\", 0.05);\n\nmarketMChain.add(new MState\u003c\u003e(\"STAGNANT\"), \"STAGNANT\", 0.5);\nmarketMChain.add(new MState\u003c\u003e(\"STAGNANT\"), \"BULL\", 0.25);\nmarketMChain.add(new MState\u003c\u003e(\"STAGNANT\"), \"BEAR\", 0.25);\n\nmarketMChain.generate(10000).forEach(System.out::println);\n```\n\nOutput:\n\n```\nSTAGNANT\nBULL\nBULL\nBULL\nBULL\n... and so on\n```\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnomemory%2Fmarkovneat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnomemory%2Fmarkovneat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnomemory%2Fmarkovneat/lists"}