{"id":19872450,"url":"https://github.com/davidace/emc-new","last_synced_at":"2026-06-10T11:31:52.449Z","repository":{"id":97018969,"uuid":"56826534","full_name":"DavidAce/EMC-New","owner":"DavidAce","description":"New version of Evolutionary monte carlo","archived":false,"fork":false,"pushed_at":"2016-07-23T15:20:11.000Z","size":164361,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-01T00:58:42.663Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DavidAce.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2016-04-22T04:37:32.000Z","updated_at":"2022-10-29T19:24:31.000Z","dependencies_parsed_at":"2023-05-20T18:34:15.120Z","dependency_job_id":null,"html_url":"https://github.com/DavidAce/EMC-New","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/DavidAce/EMC-New","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DavidAce%2FEMC-New","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DavidAce%2FEMC-New/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DavidAce%2FEMC-New/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DavidAce%2FEMC-New/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DavidAce","download_url":"https://codeload.github.com/DavidAce/EMC-New/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DavidAce%2FEMC-New/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34151274,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-10T02:00:07.152Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-11-12T16:15:39.270Z","updated_at":"2026-06-10T11:31:52.435Z","avatar_url":"https://github.com/DavidAce.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Evolutionary Monte Carlo (EMC)\nThis program finds the global minimum in a general parameter\nspace by combining Genetic algorithms and Monte Carlo \nalgorithms. \n\nReferences:\n\n[On learning strategies for evolutionary Monte Carlo](http://www.people.fas.harvard.edu/~junliu/TechRept/07folder/Goswami%26Liu07.pdf)\n\n[Evolutionary Monte Carlo for protein folding simulations](http://users.phhp.ufl.edu/faliang/papers/2001/JCP2D.pdf)\n\n[Real-parameter evolutionary Monte Carlo with applications to Bayesian mixture models](http://users.phhp.ufl.edu/faliang/papers/2001/RealEMC.pdf)\n\n## Quick Start\nFrom a Linux terminal type\n\n\t\tmake\n\t\t./EMC xy_old.dat xy_new.dat boundaries.dat\n                \t\t\n\n## Usage\nThe files `source/minimization.hpp` and `source/minimization.cpp`\nhave the function `fitnessTest()` which is used to map an n-dimensional\npoint in your parameter space, called a *chromosome*,\nto scalar `H`, called the *fitness* (or energy). You will have to re-write this \nfunction to suit your minimizing needs. Since this function is called **many**\ntimes it is important to write fast code. Do **not** use OpenMP as it is\nalready used on the outer loop that calls `fitnessTest()`.\n\nIdeally you should aim for H to be small, no larger than 50, say, since differences\nin H are present in many Boltzmann weight exponentials, as in `exp((H_new - H_old)/T)`.\n\nIf H can become very large, I suggest you leave the function that is already present:\n\n        \tH = -1 / log(H + log_param) + log_const + pow(log( 1/(H + 1)), 2);\n\nwhich basically gives your parameter hypersurface a good shape for the minimization process.\n\n### The default program\nIf you compile and run the program *as is*, it will try to find\nthe 12 coefficients of a bivariate polynomial that maps the coordinates\nin `indata/xy_old.dat` into `indata/xy_new.dat`. This type of problem is \nfound in cartography when one needs a recipe that stretches one\ngeographical map into another, that may come from a different projection.\nAll coefficients should approximate the value `2` if the program is working correctly.\n\n## Compilation \nIn a linux terminal, enter `make` to generate the binary `EMC`. \nEnter `make clean ` to clean old object files.\nThe program has been tested with g++ version 5.3.0, \nbut should work with anything later than g++ 4.9.\n\n\n## Excecution  \nEnter `./EMC file0 file1 ... fileN` to execute the \nbinary EMC with your own input files listed.\nPut your input files in a folder \"./indata/\".\nThe file run.sh is a bash script for execution.\n \n                \nAll files are optional, except the one containing the\nboundaries of your parameter space, which is\nmandatory. See format below. This file must be the last\non the argument list.\nOptional files may be used for computation of the fitness.\n                \n##### Example\n        ./EMC my_file1.dat my_file2.dat boundaries.dat\n\n                 \n                \n## File format\nFiles can contain tab-delimited matrices of size n x m\n(n = rows, m = columns).\nA matrix from `file0` is accessible from within the \nprogram as  `in.data[0]`  , which is a pointer to\nan Eigen-type matrix, MatrixXd.\n    \n##### Example\nTo get element in row 2 and column 5 from \n`file1`, you may write:\n                \n        double my_number = in.data[1](2,5);\n                       \nSee the Quick Reference to Eigen syntax here:\nhttps://eigen.tuxfamily.org/dox-devel/AsciiQuickReference.txt\n\n\nThe last argument `fileN` must always contain the domain\nboundary in two columns. The first column is the lower \nbound, and the second is the upper bound.\nThere must be as many rows as parameters for the fit!\n\n##### Example \nIf parameters `sigma`, `mu`, `rho` are to be minimized\nin a 3D cube parameter space with volume `64`, centered at origo,\nthen boundaries.dat may contain (tab delimited):\n                        \n                -2  2\n                -2  2\n                -2  2\n\n\n## Constants\nSee the file `constants.h`. In particular, set the following\nvariables to your liking: \n\n`int M` sets the number of parallel subpopulations. Preferrably this\nnumber should be the same as the number cpu-threads available for OpenMP.\n(Usually 4 to 8, depending on your cpu).\n\n\n\n`int generations` controls the maximum duration\nof the simulation (default `500000`). \n\n`double lowest_H` sets threshold for the lowest fitness. If\nany fitness is lower than `lowest_H` the program will terminate.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidace%2Femc-new","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavidace%2Femc-new","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidace%2Femc-new/lists"}