in our parameterization of the gamma(aldistributionl is the rate parameter many software packages instead use the scale parameter / be aware of this when simulating gamma random variables the python script below defines small data set of size (which was randomly simulated from standard normal distribution)and implements the systematic gibbs sampler to simulate from the posterior distributionusing samples gibbsamp py import numpy as np import matplotlib pyplot as plt np array ([- - - - ]] = size sample_mean np mean(xsample_var np var(xsig np var(xmusample_mean = ** gibbs_sample np array (np zeros (( ))for in range ( )musample_mean np sqrt(sig / )*np random randn ( =np sum (( -mu)** / sig np random gamma ( / /vgibbs_sample [ ,:]np array ([mu sig ]plt scatter gibbs_sample [, gibbs_sample [, alpha = , = plt plot(np mean( )np var( ),'wo'plt show ( ^( - - figure leftapproximate draws from the posterior pdf (us xobtained via the gibbs sampler rightestimate of the posterior pdf (