{"id":16697925,"url":"https://github.com/richfitz/simplemcmc","last_synced_at":"2025-03-14T03:44:58.178Z","repository":{"id":66276653,"uuid":"52354549","full_name":"richfitz/simplemcmc","owner":"richfitz","description":null,"archived":false,"fork":false,"pushed_at":"2016-02-23T13:31:20.000Z","size":6,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-20T22:53:54.775Z","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":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/richfitz.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":"2016-02-23T11:38:12.000Z","updated_at":"2016-02-23T15:51:23.000Z","dependencies_parsed_at":"2023-03-18T05:30:50.746Z","dependency_job_id":null,"html_url":"https://github.com/richfitz/simplemcmc","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/richfitz%2Fsimplemcmc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/richfitz%2Fsimplemcmc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/richfitz%2Fsimplemcmc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/richfitz%2Fsimplemcmc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/richfitz","download_url":"https://codeload.github.com/richfitz/simplemcmc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243521252,"owners_count":20304186,"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-12T17:49:45.911Z","updated_at":"2025-03-14T03:44:58.152Z","avatar_url":"https://github.com/richfitz.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# simplemcmc\n\n\u003e Simple MCMC With Templates\n\n**This is not meant to be used for anything.  This is just to illustrate how one might use C++ templates to avoid hassles with using function pointers.**\n\nThis is an example of using templates to make a function that needs functions (e.g. an MCMC sampler, optimiser, etc) work easily enough in R + Rcpp.  See the demo package at [tests/testthat/demo](tests/testthat/demo) for use in a package (the important bit is the `LinkingTo` field in the [DESCRIPTION](tests/testthat/demo/DESCRIPTION).  The package also has the same example in `src` and `R` (which would be the model if you had a sampler that you wanted to use multiple times within a single package).\n\n## Installation\n\n```r\ndevtools::install_github(\"richfitz/simplemcmc\")\n```\n\n## Usage\n\n```\nn \u003c- 5\nx0 \u003c- rnorm(n)\nw \u003c- runif(n, 0, 10)\npars \u003c- c(rnorm(n), runif(n))\nsamples \u003c- simplemcmc::mcmc_example(x0, w, 1000, pars)\nmatplot(samples$x, type=\"l\", lty=1)\n```\n\n## License\n\nMIT + file LICENSE © [Rich FitzJohn](https://github.com/richfitz).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frichfitz%2Fsimplemcmc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frichfitz%2Fsimplemcmc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frichfitz%2Fsimplemcmc/lists"}