{"id":42910210,"url":"https://github.com/cdemers/go-randomwalker","last_synced_at":"2026-01-30T16:56:08.164Z","repository":{"id":57540348,"uuid":"206456751","full_name":"cdemers/go-randomwalker","owner":"cdemers","description":"Package randomwalker provides a parametric random walk generator.","archived":false,"fork":false,"pushed_at":"2025-02-25T03:27:47.000Z","size":9,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-19T22:14:35.167Z","etag":null,"topics":["finance","financial-analysis","gaussian","golang","golang-library","math","random-walk","randomwalk","simulation","walker"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cdemers.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-09-05T02:21:58.000Z","updated_at":"2025-02-25T03:27:51.000Z","dependencies_parsed_at":"2022-09-26T18:30:38.595Z","dependency_job_id":null,"html_url":"https://github.com/cdemers/go-randomwalker","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cdemers/go-randomwalker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdemers%2Fgo-randomwalker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdemers%2Fgo-randomwalker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdemers%2Fgo-randomwalker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdemers%2Fgo-randomwalker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cdemers","download_url":"https://codeload.github.com/cdemers/go-randomwalker/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdemers%2Fgo-randomwalker/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28915942,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-30T16:37:38.804Z","status":"ssl_error","status_checked_at":"2026-01-30T16:37:37.878Z","response_time":66,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["finance","financial-analysis","gaussian","golang","golang-library","math","random-walk","randomwalk","simulation","walker"],"created_at":"2026-01-30T16:56:08.061Z","updated_at":"2026-01-30T16:56:08.150Z","avatar_url":"https://github.com/cdemers.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Simple Random Walker\n\n**Simple random walker to be used for non-cryptographic simulations, like\nnatural phenomenon models or finance**\n\n[![GoDoc](https://godoc.org/github.com/cdemers/go-randomwalker?status.svg)](https://godoc.org/github.com/cdemers/go-randomwalker)\n[![Go Report Card](https://goreportcard.com/badge/github.com/cdemers/go-randomwalker)](https://goreportcard.com/report/github.com/cdemers/go-randomwalker)\n\nPackage randomwalker provides a parametric random walk generator. You can\ninstantiate a random walker that will start at a specific point, that will stay\nbetween an upper and lower boundary, that will vary on each step by a specified\nmaximum magnitude.\n\nAlso, if you expect to use this walker for financial models, this walker is\ngoing to give you something close to a Gaussian random walk, and not a Brownian\nrandom walk.\n\nCalling NewRandomWalker() returns a Gaussian like random walk generator.  Once\ncreated, you can call Step() on this object to get the first and then the\nsubsequent random walk value.\n\nIts signature is `NewRandomWalker(origin, min, max, maxDynPcnt float32)`.\n\n- The _origin_ parameter sets the initial walk value, it's starting point.\n- The _min_ parameter sets a limit on how low can the walk go.\n- The _max_ parameter sets a limit on how high the walk can go.\n- The _maxDynPcnt_ parameter sets the limit on how much can a walk step vary from\n  its previous value. Setting this value at zero will prevent the walk from\n  varying at all, leaving it constantly at it's initial value. Setting this\n  value at 1.0 will allow the walk step to vary from -50% to +50% of its\n  previous value (the difference between -50% and +50% totaling 1.0). And\n  setting this value to more than 1.0 is permitted, for example setting it to 4.0\n  will allow a step to vary between -200% and +200% of its previous value.\n\nCalling `Step()` afterward will return a float32 value.\n\nUsing NewRandomWalkerWithRandSource() also returns a random walk generator but\nthat here you can provide your own random source object if needed.\n\n**Example**\n\n```go\nvar origin, minimumWalkValue, maximumWalkValue, maximumVariationPercentage float32\n\norigin = 50\nminimumWalkValue = -25\nmaximumWalkValue = 75\nmaximumVariationPercentage = 0.01\n\nrw = NewRandomWalker(origin, minimumWalkValue, maximumWalkValue, maximumVariationPercentage)\nvalue = rw.Step()\n// _value_ will be somewhere between (50 + 1%) and (50 - 1%).\nvalue = rw.Step()\n// _value_ will now be its previous value plus or minus 1%.\n```\n\n# Development\n\n## Running tests\n\nInclude race condition detection when testing with:\n\n```bash\ngo test -race\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcdemers%2Fgo-randomwalker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcdemers%2Fgo-randomwalker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcdemers%2Fgo-randomwalker/lists"}