{"id":17222920,"url":"https://github.com/cheind/monte-carlo-integration","last_synced_at":"2025-07-28T13:32:56.883Z","repository":{"id":39291047,"uuid":"506867746","full_name":"cheind/monte-carlo-integration","owner":"cheind","description":"Theory and implementation of Monte Carlo integration techniques","archived":false,"fork":false,"pushed_at":"2022-08-21T09:25:06.000Z","size":894,"stargazers_count":4,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-16T04:06:42.343Z","etag":null,"topics":["monte-carlo-integration","python","theory"],"latest_commit_sha":null,"homepage":"","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/cheind.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":"2022-06-24T03:41:42.000Z","updated_at":"2024-07-07T13:27:04.000Z","dependencies_parsed_at":"2022-09-01T08:03:04.843Z","dependency_job_id":null,"html_url":"https://github.com/cheind/monte-carlo-integration","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/cheind%2Fmonte-carlo-integration","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cheind%2Fmonte-carlo-integration/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cheind%2Fmonte-carlo-integration/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cheind%2Fmonte-carlo-integration/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cheind","download_url":"https://codeload.github.com/cheind/monte-carlo-integration/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227915848,"owners_count":17839495,"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":["monte-carlo-integration","python","theory"],"created_at":"2024-10-15T04:06:43.189Z","updated_at":"2024-12-03T12:22:28.037Z","avatar_url":"https://github.com/cheind.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.7013396.svg)](https://doi.org/10.5281/zenodo.7013396)\n\n# Monte Carlo Integration\n\nTheory and implementation of Monte Carlo integration in Python.\n\n## Theory\n\nSee [docs/monte_carlo_integration.pdf](docs/monte_carlo_integration.pdf) for a write-up of my research notes.\n\n## Example\n\nHere is an example using indicator functions.\n\n```python\nimport numpy as np\n\nimport mcintegration as mci\n\n# Indicator function for being inside a unit sphere in R^N\ni = lambda x: np.sum(x**2, -1) \u003c= 1.0\n\n# Area of unit circle in R^2\nA_circle, err_one_sigma = mci.mcintegrate(\n    i,\n    lower=[-1.0] * 2,\n    upper=[1.0] * 2,\n    n=int(1e5),\n)\nprint(A_circle, err_one_sigma)\n# 3.1438 0.00129\n\n# Volume of unit sphere in R^3\nV_sphere, err_one_sigma = mci.mcintegrate(\n    i,\n    lower=[-1.0] * 3,\n    upper=[1.0] * 3,\n    n=int(1e5),\n)\nprint(V_sphere, err_one_sigma)\n# 4.1735 0.00157\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcheind%2Fmonte-carlo-integration","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcheind%2Fmonte-carlo-integration","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcheind%2Fmonte-carlo-integration/lists"}