R code for parameter estimates in regression models using different methods:
- Least squares
- Gradient descent
- Metropolis-Hastings
- Gibbs sampling using JAGS
The code is for a linear regression problem with one single predictor (univariate regression). The aim is to introduce important aspects widely used in machine learning, such as gradient descent and Monte Carlo methods, using a simple example and providing basic implementations for all methods.
The different approaches and code are explained in this blog post: http://www.marcoaltini.com/blog/parameter-estimates-for-regression-least-squares-gradient-descent-and-monte-carlo-methods