Package: hmclearn 0.0.5

Samuel Thomas

hmclearn: Fit Statistical Models Using Hamiltonian Monte Carlo

Provide users with a framework to learn the intricacies of the Hamiltonian Monte Carlo algorithm with hands-on experience by tuning and fitting their own models. All of the code is written in R. Theoretical references are listed below:. Neal, Radford (2011) "Handbook of Markov Chain Monte Carlo" ISBN: 978-1420079418, Betancourt, Michael (2017) "A Conceptual Introduction to Hamiltonian Monte Carlo" <arxiv:1701.02434>, Thomas, S., Tu, W. (2020) "Learning Hamiltonian Monte Carlo in R" <arxiv:2006.16194>, Gelman, A., Carlin, J. B., Stern, H. S., Dunson, D. B., Vehtari, A., & Rubin, D. B. (2013) "Bayesian Data Analysis" ISBN: 978-1439840955, Agresti, Alan (2015) "Foundations of Linear and Generalized Linear Models ISBN: 978-1118730034, Pinheiro, J., Bates, D. (2006) "Mixed-effects Models in S and S-Plus" ISBN: 978-1441903174.

Authors:Samuel Thomas [cre, aut], Wanzhu Tu [ctb]

hmclearn_0.0.5.tar.gz
hmclearn_0.0.5.zip(r-4.5)hmclearn_0.0.5.zip(r-4.4)hmclearn_0.0.5.zip(r-4.3)
hmclearn_0.0.5.tgz(r-4.4-any)hmclearn_0.0.5.tgz(r-4.3-any)
hmclearn_0.0.5.tar.gz(r-4.5-noble)hmclearn_0.0.5.tar.gz(r-4.4-noble)
hmclearn_0.0.5.tgz(r-4.4-emscripten)hmclearn_0.0.5.tgz(r-4.3-emscripten)
hmclearn.pdf |hmclearn.html
hmclearn/json (API)
NEWS

# Install 'hmclearn' in R:
install.packages('hmclearn', repos = c('https://sthomas522.r-universe.dev', 'https://cloud.r-project.org'))

Peer review:

Bug tracker:https://github.com/sthomas522/hmclearn/issues

Datasets:
  • Drugs - Student Drug Usage Dataset
  • Endometrial - Endometrial Cancer Dataset
  • Gdat - Count of Fresh Gopher Tortoise Shells

On CRAN:

39 exports 11 stars 1.52 score 47 dependencies 14 scripts 169 downloads

Last updated 4 years agofrom:c3acc7dabd. Checks:OK: 7. Indexed: yes.

TargetResultDate
Doc / VignettesOKSep 07 2024
R-4.5-winOKSep 07 2024
R-4.5-linuxOKSep 07 2024
R-4.4-winOKSep 07 2024
R-4.4-macOKSep 07 2024
R-4.3-winOKSep 07 2024
R-4.3-macOKSep 07 2024

Exports:diagplotsg_glmm_bin_posteriorg_glmm_poisson_posteriorg_linear_posteriorg_lmm_posteriorg_logistic_posteriorg_poisson_posteriorglmm_bin_posteriorglmm_poisson_posteriorhmchmc.fitleapfroglinear_posteriorlmm_posteriorlogistic_posteriormcmc_acfmcmc_acf_barmcmc_areasmcmc_densmcmc_hexmcmc_histmcmc_hist_by_chainmcmc_intervalsmcmc_neffmcmc_neff_datamcmc_neff_histmcmc_pairsmcmc_rhatmcmc_rhat_histmcmc_scattermcmc_tracemcmc_violinmhmh.fitneffpoisson_posteriorpsrfqfunqprop

Dependencies:abindbackportsbayesplotcheckmateclicolorspacedistributionaldplyrfansifarvergenericsggplot2ggridgesgluegtableisobandlabelinglatticelifecyclemagrittrMASSMatrixmatrixStatsmgcvmunsellmvtnormnlmenumDerivpillarpkgconfigplyrposteriorR6RColorBrewerRcppreshape2rlangscalesstringistringrtensorAtibbletidyselectutf8vctrsviridisLitewithr

hmclearn: Linear Mixed Effects Regression Example

Rendered fromlinear_mixed_effects_hmclearn.Rmdusingknitr::rmarkdownon Sep 07 2024.

Last update: 2020-10-04
Started: 2020-04-24

hmclearn: Linear Regression Example

Rendered fromlinear_regression_hmclearn.Rmdusingknitr::rmarkdownon Sep 07 2024.

Last update: 2020-10-04
Started: 2020-04-24

hmclearn: Logistic Mixed Effects Regression Example

Rendered fromlogistic_mixed_effects_hmclearn.Rmdusingknitr::rmarkdownon Sep 07 2024.

Last update: 2020-10-04
Started: 2020-04-24

hmclearn: Logistic Regression Example

Rendered fromlogistic_regression_hmclearn.Rmdusingknitr::rmarkdownon Sep 07 2024.

Last update: 2020-10-04
Started: 2020-04-24

hmclearn: Poisson Regression Example

Rendered frompoisson_regression_hmclearn.Rmdusingknitr::rmarkdownon Sep 07 2024.

Last update: 2020-10-04
Started: 2020-04-24

Readme and manuals

Help Manual

Help pageTopics
Extract Model Coefficientscoef.hmclearn
Diagnostic plots for 'hmclearn'diagplots
Diagnostic plots for 'hmclearn'diagplots.hmclearn
Student Drug Usage DatasetDrugs
Endometrial Cancer DatasetEndometrial
Count of Fresh Gopher Tortoise ShellsGdat
Fit a generic model using Hamiltonian Monte Carlo (HMC)hmc
Fitter function for Hamiltonian Monte Carlo (HMC)hmc.fit
Sample log posterior and gradient functions for select generalized linear models and mixed effect modelsglmm_bin_posterior glmm_poisson_posterior g_glmm_bin_posterior g_glmm_poisson_posterior g_linear_posterior g_lmm_posterior g_logistic_posterior g_poisson_posterior hmclearn-glm-posterior linear_posterior lmm_posterior logistic_posterior poisson_posterior
Plotting for MCMC visualization and diagnostics provided by 'bayesplot' packagehmclearn-plots mcmc_acf mcmc_acf.hmclearn mcmc_acf_bar mcmc_acf_bar.hmclearn mcmc_areas mcmc_areas.hmclearn mcmc_dens mcmc_dens.hmclearn mcmc_hex mcmc_hex.hmclearn mcmc_hist mcmc_hist.hmclearn mcmc_hist_by_chain mcmc_hist_by_chain.hmclearn mcmc_intervals mcmc_intervals.hmclearn mcmc_neff mcmc_neff.hmclearn mcmc_neff_data mcmc_neff_data.hmclearn mcmc_neff_hist mcmc_neff_hist.hmclearn mcmc_pairs mcmc_pairs.hmclearn mcmc_rhat mcmc_rhat.hmclearn mcmc_rhat_hist mcmc_rhat_hist.hmclearn mcmc_scatter mcmc_scatter.hmclearn mcmc_trace mcmc_trace.hmclearn mcmc_violin mcmc_violin.hmclearn
Leapfrog Algorithm for Hamiltonian Monte Carloleapfrog
Fit a generic model using Metropolis-Hastings (MH)mh
Fitter function for Metropolis-Hastings (MH)mh.fit
Effective sample size calculationneff
Effective sample size calculationneff.hmclearn
Plot Histograms of the Posterior Distributionplot.hmclearn
Model Predictions for HMC or MHpredict.hmclearn
Calculates Potential Scale Reduction Factor (psrf), also called the Rhat statistic, from models fit via 'mh' or 'hmc'psrf
Calculates Potential Scale Reduction Factor (psrf), also called the Rhat statistic, from models fit via 'mh' or 'hmc'psrf.hmclearn
Multivariate Normal Density of Theta1 | Theta2qfun
Simulate from Multivariate Normal Density for Metropolis Algorithmqprop
Summarizing HMC Model Fitssummary.hmclearn