{"id":21510555,"url":"https://github.com/elkronos/bmber","last_synced_at":"2025-03-17T15:20:38.174Z","repository":{"id":187783011,"uuid":"677566214","full_name":"elkronos/bmbeR","owner":"elkronos","description":"Bayesian Model Building and Evaluation Repository","archived":false,"fork":false,"pushed_at":"2025-02-18T04:30:51.000Z","size":27,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-18T05:26:46.983Z","etag":null,"topics":["bayesian-inference","bayesian-statistics","r","rstan","sensitivity-analysis","statistics"],"latest_commit_sha":null,"homepage":"","language":"R","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/elkronos.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}},"created_at":"2023-08-11T23:14:55.000Z","updated_at":"2025-02-18T04:30:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"f41ea515-f36c-4b08-a9c3-a89bba125240","html_url":"https://github.com/elkronos/bmbeR","commit_stats":null,"previous_names":["elkronos/bmber"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elkronos%2FbmbeR","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elkronos%2FbmbeR/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elkronos%2FbmbeR/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elkronos%2FbmbeR/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elkronos","download_url":"https://codeload.github.com/elkronos/bmbeR/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244056428,"owners_count":20390720,"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":["bayesian-inference","bayesian-statistics","r","rstan","sensitivity-analysis","statistics"],"created_at":"2024-11-23T21:49:22.178Z","updated_at":"2025-03-17T15:20:38.168Z","avatar_url":"https://github.com/elkronos.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bmbeR: Bayesian Model Building and Evaluation Repository\n\nThis repository contains a set of R scripts designed to build, evaluate, visualize, and perform sensitivity analysis on Bayesian models. These scripts use a mixture of `rstan`, `rstanarm`, and other Bayesian analysis libraries to facilitate the modeling process.\n\n## Scripts and Their Functions:\n\n### libraries_and_setup.R\n- **Purpose:** Loads the necessary libraries and global settings for the entire modeling workflow.\n- **Libraries Used:**\n  - `rstanarm`\n  - `bayesplot`\n  - `ggplot2`\n  - `cowplot`\n  - `purrr`\n  - `rstan`\n  - `loo`\n\n### distributions.R\n- **Purpose:** Defines a comprehensive set of prior distribution generators.\n- **Functions:**\n  - `student_t_prior`\n  - `normal_prior`\n  - `cauchy_prior`\n  - `uniform_prior`\n  - `beta_prior`\n  - `gamma_prior`\n  - `binomial_prior`\n  - `poisson_prior`\n  - `lognormal_prior`\n  - `bernoulli_prior`\n- **Global Objects and Utilities:**\n  - `original_distributions`, `distributions`\n  - `add_distribution`, `reset_distributions`, `get_prior_distribution`\n\n### utilities.R\n- **Purpose:** Provides utility functions used across the repository.\n- **Functions:**\n  - `validate_positive_integer`\n  - `validate_numeric`\n  - `%||%` (null-coalescing operator)\n\n### empirical_bayes.R\n- **Purpose:** Computes empirical Bayesian hyperparameter specifications from data.\n- **Functions:**\n  - `empirical_bayes_priors`: Fits a linear model and maps coefficient estimates and standard errors to hyperparameters for various prior distributions.\n\n### model_convergence.R\n- **Purpose:** Checks convergence diagnostics of a fitted Bayesian model.\n- **Functions:**\n  - `check_convergence`: Assesses if a model has converged based on Rhat and effective sample size (ESS) metrics, and optionally generates trace plots.\n\n### model_fitting.R\n- **Purpose:** Fits Bayesian models using specified prior configurations and data.\n- **Functions:**\n  - `build_stanarm_priors`: Converts hyperparameter lists into rstanarm prior objects.\n  - `fit_model_with_prior`: Fits a Bayesian model using `rstanarm::stan_glm` with given priors, and checks for convergence.\n\n### model_visualization.R\n- **Purpose:** Generates diagnostic and posterior visualization plots for fitted models.\n- **Functions:**\n  - `generate_plot`: Generates diagnostic plots (trace, histogram, density, and autocorrelation) for a model.\n  - `plot_posterior_distributions`: Visualizes posterior distributions with 95% credible intervals using bayesplot.\n\n### model_sensitivity.R\n- **Purpose:** Performs sensitivity analysis across different prior configurations.\n- **Functions:**\n  - `sensitivity_analysis`: Iterates through a list of prior configurations, fits models, and computes performance metrics (using LOO) to assess how changes in priors affect model outcomes.\n\n### model_evaluation.R\n- **Purpose:** Evaluates the predictive performance of fitted models.\n- **Functions:**\n  - `evaluate_model_performance`: Computes performance metrics such as RMSE and MAE for regression tasks, or accuracy, precision, recall, and F1 Score for classification tasks.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felkronos%2Fbmber","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felkronos%2Fbmber","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felkronos%2Fbmber/lists"}