## This is a reproduction of Bishop -- Pattern Recognition and Machines Learning's example of pages
##   154,155 The true generator is the function f(x) = -0.3x + 0.5 with a normal noise of sd 0.2
##   The model receives one point per iteration and updates itself using Bayes rule. The left panel
##   shows a countour of the join distribution for the estimates of f(x), namely w0 and w1. The
##   right panel shows the current set of points, 10 linear estimations given the model's current
##   knowledge (in grey), and the mean (in red).
library(animation)
library(MASS)
par(mar = c(3, 2.5, 1, 0.2), pch = 20, mgp = c(1.5, 0.5, 
    0))
ani.options(nmax = ifelse(interactive(), 30, 30), interval = 1)
bayes_reg()
## R version 3.2.0 (2015-04-16)
## Platform: x86_64-w64-mingw32/x64 (64-bit)
## Other packages: animation 2.3, MASS 7.3-40