{"id":17191130,"url":"https://github.com/dfm/emcee.js","last_synced_at":"2025-04-13T19:50:33.258Z","repository":{"id":3844376,"uuid":"4928176","full_name":"dfm/emcee.js","owner":"dfm","description":"Just a slick little Markov chain Monte Carlo sampler written in Javascript...","archived":false,"fork":false,"pushed_at":"2020-06-12T18:17:42.000Z","size":86,"stargazers_count":7,"open_issues_count":3,"forks_count":1,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-27T10:21:38.836Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://danfm.ca/emcee.js/","language":"JavaScript","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/dfm.png","metadata":{"files":{"readme":"README.markdown","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.markdown","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-07-06T17:04:00.000Z","updated_at":"2020-11-27T04:29:25.000Z","dependencies_parsed_at":"2022-08-27T16:00:29.913Z","dependency_job_id":null,"html_url":"https://github.com/dfm/emcee.js","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/dfm%2Femcee.js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfm%2Femcee.js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfm%2Femcee.js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfm%2Femcee.js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dfm","download_url":"https://codeload.github.com/dfm/emcee.js/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248773680,"owners_count":21159516,"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-15T01:24:57.960Z","updated_at":"2025-04-13T19:50:33.233Z","avatar_url":"https://github.com/dfm.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"emcee.js\n========\n\nThis a Javascript implementation of [emcee](http://danfm.ca/emcee).\n\nUsage\n-----\n\n1. Write down the density that you want to sample:\n\n         var lnprobfn = function (x) {\n             var i, result = 0.0;\n             for (i = 0; i \u003c x.length; i++) result -= 0.5 * x[i] * x[i];\n             return result;\n         };\n\n2. Initialize an `EnsembleSampler` object:\n\n         var sampler = new emcee.EnsembleSampler(lnprobfn);\n\n3. Make an initial guess at positions for 100 walkers in 3 dimensions,\n   in this particular case, it's going to be a small Gaussian ball:\n\n         var initialPosition = emcee.smallBall(100, [0.1, 2, -0.5], [1.0, 0.1, 0.5]);\n\n4. Run the heck out of it and take 1000 samples:\n\n         sampler.runMCMC(initialPosition, 1000);\n\n5. The acceptance fraction is `sampler.acceptanceFraction` and the chain\n   is stored in `sampler.chain`.\n\n6. Now make some sort of **sick front end**!\n\nExample\n-------\n\nTo see an example, run `python -m SimpleHTTPServer 8000` in the root directory of this\nrepository and navigate to [localhost:8000/examples](http://localhost:8000/examples).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdfm%2Femcee.js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdfm%2Femcee.js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdfm%2Femcee.js/lists"}