rodolformelo / Metropolis-Hastings-Algorithm

In the first semester of my MSc. studies, we developed a phyton version of the Gibbs Sampler and Metropolis-Hastings Algorithm from the scratch. We described our results and analysis in a report.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Metropolis-Hastings-Algorithm

For implementing Metropolis-Hastings algorithm simulated data were used with k=3 covariates and a constant term. A multivariate normal distribution was taken as a prior for formula, N(0,formula) where formula is a diagonal matrix with formula on the diagonal. After considering a number of values for formula, formula = 1 was chosen. The posterior distribution was simulated using as proposal a multivariate normal distribution centered at the current update of and with a covariance matrix given by the inverse of Fisher information evaluated at the current update.

Gibbs Sampler for binary data

For this analyse, we simulated N independent binary random variables where each yi comes from a Bernoulli distribution with probability of success formula.

About

In the first semester of my MSc. studies, we developed a phyton version of the Gibbs Sampler and Metropolis-Hastings Algorithm from the scratch. We described our results and analysis in a report.

License:MIT License


Languages

Language:Python 100.0%