{"id":32348409,"url":"https://github.com/gregorsteiner/givbma.jl","last_synced_at":"2026-02-22T02:03:47.459Z","repository":{"id":277337434,"uuid":"872468416","full_name":"gregorsteiner/gIVBMA.jl","owner":"gregorsteiner","description":"Bayesian Model Averaging in instrumental variable models.","archived":false,"fork":false,"pushed_at":"2025-05-08T09:25:11.000Z","size":161,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-08T10:32:35.797Z","etag":null,"topics":["bayesian-statistics","causal-inference","instrumental-variables","model-averaging","model-selection"],"latest_commit_sha":null,"homepage":"","language":"Julia","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/gregorsteiner.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,"zenodo":null}},"created_at":"2024-10-14T13:43:42.000Z","updated_at":"2025-05-08T09:25:15.000Z","dependencies_parsed_at":"2025-05-08T10:36:41.542Z","dependency_job_id":null,"html_url":"https://github.com/gregorsteiner/gIVBMA.jl","commit_stats":null,"previous_names":["gregorsteiner/givbma.jl"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/gregorsteiner/gIVBMA.jl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gregorsteiner%2FgIVBMA.jl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gregorsteiner%2FgIVBMA.jl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gregorsteiner%2FgIVBMA.jl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gregorsteiner%2FgIVBMA.jl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gregorsteiner","download_url":"https://codeload.github.com/gregorsteiner/gIVBMA.jl/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gregorsteiner%2FgIVBMA.jl/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280761858,"owners_count":26386245,"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","status":"online","status_checked_at":"2025-10-24T02:00:06.418Z","response_time":73,"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":["bayesian-statistics","causal-inference","instrumental-variables","model-averaging","model-selection"],"created_at":"2025-10-24T07:54:11.413Z","updated_at":"2025-10-24T07:54:16.779Z","avatar_url":"https://github.com/gregorsteiner.png","language":"Julia","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gIVBMA.jl\n\n[![Build Status](https://github.com/gregorsteiner/IVBMA.jl/workflows/CI/badge.svg)](https://github.com/gregorsteiner/IVBMA.jl/actions)\n\nBayesian Model Averaging in Instrumental Variable Models. This package implements the gIVBMA method proposed in Steiner and Steel (2025).\n\n## Installation\n\nThe package is not yet available from the general registry, but can be installed directly from GitHub:\n```julia\nusing Pkg; Pkg.add(url=\"https://github.com/gregorsteiner/gIVBMA.jl.git\")\n```\n\n## Usage\n\nThe main function is `givbma` which requires an outcome vector `y`, a matrix of endogenous variables `X`, a matrix of potential instruments `Z`, and a matrix of potential (exogenous) covariates `W`:\n```julia\nfit = givbma(y, X, Z, W)\n```\nwill return a `GIVBMA` object containing a posterior sample of the model parameters averaged over the outcome and treatment models, the visited outcome and treatment models, and the input data. Alternatively, one can only specify a matrix `Z` of potential instruments and covariates:\n```julia\nfit = givbma(y, X, Z)\n```\nwhich allows all columns of `Z` to be included in the outcome and treatment model. Note that an intercept is automatically included and there is no need to include it in either `X`, `W`, or `Z`. The optional keyword arguments are:\n* `iter`: the number of iterations.\n* `burn`: the number of iterations discarded as burn-in; the function returns `iter-burn` posterior samples.\n* `dist`: a vector of distributions of the outcome and the endogenous variables (defaults to Gaussian). Currently, we support `\"Gaussian\"`, `\"PLN\"` (Poisson-Log-Normal), and `\"BL\"` (Beta-Logistic).\n* `g_prior`: the choice of the g hyperparameter. Currently, we support `\"BRIC\"` (default) and `\"hyper-g/n\"`.\n* `two_comp`: a Boolean indicating whether the two-component g-prior should be used in the treatment model (defaults to `false`). The two-component prior can only be used with a single endogenous variable (i.e. `X` only has a single column).\n* `ν`: the degrees of freedom parameter for the inverse Wishart prior on the covariance matrix. If not specified, this defaults to an Exponential hyperprior.\n* `m`: the prior mean model size. If not specified, it defaults to `k/2` in the outcome model and `(k+p)/2` in the treatment model, where `k` is the number of exogenous covariates and `p` is the number of instruments.\n* `r_prior`: a `Distribution` object specifying the prior on additional parameters for any non-Gaussian distributions involved. Currently, this only includes the dispersion parameter of the Beta-Logistic distribution (which defaults to an Exponential with scale 1).\n\nA useful function is `rbw`:\n```julia\nposterior = rbw(fit)\n```\nwhich returns a vector of `Distribution` objects containing Rao-Blackwellized estimates of the marginal posterior distributions of each component of the treatment effect vector. This can be used to extract summary statistics or plot the marginal posterior distribution:\n```julia\n# Extract a vector of posterior means or medians\nmap(mean, posterior)\nmap(median, posterior)\n\n# Plot the posterior distribution corresponding to the first column of X\nusing CairoMakie\nlines(posterior[1])\n```\n\n## References\n\nSteiner, G. and Steel, M. (2025). Bayesian Model Averaging in Causal Instrumental Variable Models. arXiv:2504.13520\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgregorsteiner%2Fgivbma.jl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgregorsteiner%2Fgivbma.jl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgregorsteiner%2Fgivbma.jl/lists"}