Giter VIP home page Giter VIP logo

bayeslm's Introduction

A case study in the implementation of a Bayesian linear model using R and / or C++ libraries

As an exercise I decided to implement a Bayesian linear model using the C++ libraries Armadillo and Eigen, and then to interface the C++ code from R via Rcpp. The main purpose of this exercise was to obtain some familiarity with these libraries and packages. Additionally I am also interested in comparing the speeds of the implementations for this problem and practicing profiling techniques on the software.

A more detailed explanation of the functions / programs found in this repository can be found at Writeup/Bayes_LM_Writeup.pdf. The file also displays my findings and experiences in terms of speed comparisons and program profiling.


The root directory contains the following files:

  1. bayes_lm_r: an R function

    • Bayes_LM.R
    • Check_Valid_Input.R
  2. bayes_lm_arma: a C++-only implementation using the Armadillo library (an executable)

    • Bayes_LM_Arma.cpp
    • Parse_Args.cpp
    • Stats_Fcns_Arma.cpp
  3. bayes_lm_eigen: a C++-only implementation using the Eigen library (an executable)

    • Bayes_LM_Eigen.R
    • Parse_Args.cpp
    • Stats_Fcns_Eigen.cpp
  4. bayes_lm_rcpp_arma: an R function internally calling a workhorse C++ function constructed using the Armadillo library

    • Bayes_LM_Rcpp_Arma.R
    • Check_Valid_Input.R
    • Stats_Fcns_Arma.cpp
  5. bayes_lm_rcpp_eigen: an R function internally calling a workhorse C++ function constructed using the Eigen library

    • Bayes_LM_Rcpp_Eigen.R
    • Check_Valid_Input.R
    • Stats_Fcns_Eigen.cpp

Implementation speed comparisons

Compare the speeds of the programs as the number of observations (i.e. as n) increases

As n increases

Compare the speeds of the programs as the number of variables (i.e. as p) increases

As p increases

bayeslm's People

Stargazers

Saki Kuzushima avatar Justinas Smertinas avatar Nicolo' Foppa Pedretti avatar 哀蚊 avatar Tomoya Sasaki avatar Brian G. Barkley avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.