Add Binary
Given two binary strings, return their sum (also a binary string).
For example,
a = “11”
b = “1”
Return “100”.
Given two binary strings, return their sum (also a binary string).
For example,
a = “11”
b = “1”
Return “100”.
While there are certainly good software packages out there to do the job for you, notably BUGS or JAGS, it is instructive to program a simple MCMC yourself. In this post, I give an educational example of the Bayesian equivalent of a linear regression, sampled by an MCMC with Metropolis-Hastings steps, based on an earlier version which I did to together with Tamara Münkemüller. Since first publishing this post, I have made a few small modifications to improve clarity. A similar post on Metropolis-Hastings MCMC algorithms by Darren Wilkinson is also worth looking at. More on analyzing the results of this algorithm can be found in a recent post.
Adapted from http://scikit-learn.org/stable/auto_examples/tree/plot_tree_regression.html
Adapted from http://scikit-learn.org/stable/auto_examples/classification/plot_classifier_comparison.html
Adapted from http://scikit-learn.org/stable/auto_examples/plot_cv_predict.html
Adapted from http://scikit-learn.org/stable/auto_examples/cluster/plot_cluster_comparison.html