{"id":17384559,"url":"https://github.com/pgdr/mcelfish","last_synced_at":"2025-03-27T21:18:34.130Z","repository":{"id":139058527,"uuid":"302039146","full_name":"pgdr/mcelfish","owner":"pgdr","description":null,"archived":false,"fork":false,"pushed_at":"2020-12-01T15:17:47.000Z","size":173,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-01T23:42:08.508Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","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/pgdr.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-10-07T13:06:52.000Z","updated_at":"2020-12-01T15:17:49.000Z","dependencies_parsed_at":null,"dependency_job_id":"94b73e31-fd24-4a56-9e00-fc2b14640bd3","html_url":"https://github.com/pgdr/mcelfish","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pgdr%2Fmcelfish","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pgdr%2Fmcelfish/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pgdr%2Fmcelfish/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pgdr%2Fmcelfish/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pgdr","download_url":"https://codeload.github.com/pgdr/mcelfish/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245924501,"owners_count":20694731,"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-16T07:45:51.902Z","updated_at":"2025-03-27T21:18:34.105Z","avatar_url":"https://github.com/pgdr.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mcelfish -- MCMC Removal Sampling\n\nDo _removal sampling_ with MCMC, Zippin, or Carle-Strub.\n\n**Usage:**\n\n```\nmcelfish --data 19 17 13 1 1\n```\n\n```\nmcelfish --plot --data 19 17 13 1 1\n```\n\n\n## Installing\n\n```\npip install mcelfish\n```\n\nor from source\n\n```\ngit clone git@github.com:pgdr/mcelfish\npip install -e ./mcelfish\n```\n\n\n## Removal sampling\n\nSuppose that you want to\n[estimate the number of apples in an apple tree](https://stats.stackexchange.com/questions/491165/estimating-the-number-of-apples-in-an-apple-tree-using-mcmc)\nby repeatedly kicking the tree and counting how many apples fall down.\nWe make an assumption that there is a (constant) _p_ between 0 and 1,\nsuch that the probability that any given apple falls down when you kick\nthe tree is _p_.\n\nSuppose that the apple tree contains _N_ apples.  Given a series of\nkicks, we want to estimate _N_ and _p_.\n\nWe call this problem _removal sampling_.\n\n\n### Examples\n\nSuppose that `[100, 10, 1, 0]` apples fall down.  In this case, we may\nestimate _p_ to be approximately 0.9, and _N_ approximately 111.\n\nSuppose that `[19, 17, 13, 1, 1]` apples fall down.  In this more\ncomplicated case, Bayesian statistics tell us that we should expect\n_53 ≤ N ≤ 57_ and _0.4 ≤ p ≤ 0.45_.\n\n![traceplot](https://raw.githubusercontent.com/pgdr/mcelfish/main/assets/traceplot.png)\n\n## Advanced MCMC usage\n\nThis package uses [pymc3](https://pypi.org/project/pymc3/).  Tuning the\nMCMC run can be done with the parameters `--samplings` and `--tunings`,\ne.g.\n\n```\nmcelfish --samples 10000 --tunings 5000 --plot --data 19 17 13 1 1\n```\n\nWe can use `--beta` to output the beta parameters for the posterior.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpgdr%2Fmcelfish","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpgdr%2Fmcelfish","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpgdr%2Fmcelfish/lists"}