print(f"{zr[k]:12.6f}", end=' ') print(f"{vzr[k] / (zr[k] * zr[k]):14.6f}", end=' ') print() vmlnl = sum(vzr / (zr * zr)) lnml = sum(numpy.log(zr) + maxima) if args.gram: from gram import Plot gp = Plot() xx = list(bb[:-1]) yy = list(meanLogLikes) #gp.svgPxForCm = 100 gp.baseName = 'meanLogLikes' #gp.scatter(xx, yy) gp.line(xx, yy) gp.xAxis.title = r'$\beta_k$' gp.yAxis.title = 'mean log likelihood' gp.minXToShow = 0 gp.maxXToShow = 1 gp.pdf() #print(meanLogLikes) #print(maxima) #print(zr) #print(ess) #print(vzr) # print(vmlnl) print("log marginal likelihood:", lnml)
from gram import Plot read("data1.py") gp = Plot() gp.svgPxForCm = 100 gp.baseName = 'scatter' gp.scatter(xx1, yy1) gp.yAxis.title = 'scratches' gp.xAxis.title = 'itches' gp.minXToShow = 0 gp.maxXToShow = 12 gp.minYToShow = 0. gp.maxYToShow = 34 gp.png() gp.svg()
from gram import Plot from data5 import xx1, yy1, binNames, binVals gp = Plot() gp.baseName = 'lineAndBar_good' c = gp.bars(binNames,binVals) gp.minBarValToShow = 0.0 gp.barNameAxis.title = None gp.barValAxis.title = 'frequency' c.barSets[0].fillColor = 'black!10' gp.barNameAxis.barLabelsEvery = 2 #gp.barNameAxis.textRotate = 90 gp.line(xx1, yy1, smooth=True) gp.xAxis.position = 't' gp.yAxis.position = 'r' gp.xAxis.title = None gp.yAxis.title = 'density' gp.maxXToShow = 4.0 gp.xAxis.tickLabelsEvery = 1 gp.maxBarValToShow = 5000 gp.maxYToShow = 1.0 gp.font = 'helvetica' gp.png() gp.svg()
from gram import Plot read('data5.py') gp = Plot() gp.baseName = 'lineAndBar_good' c = gp.bars(binNames, binVals) gp.minBarValToShow = 0.0 gp.barNameAxis.title = None gp.barValAxis.title = 'frequency' c.barSets[0].fillColor = 'black!10' gp.barNameAxis.barLabelsEvery = 2 #gp.barNameAxis.textRotate = 90 gp.line(xx1, yy1, smooth=True) gp.xAxis.position = 't' gp.yAxis.position = 'r' gp.xAxis.title = None gp.yAxis.title = 'density' gp.maxXToShow = 4.0 gp.xAxis.tickLabelsEvery = 1 gp.maxBarValToShow = 5000 gp.maxYToShow = 1.0 gp.png() gp.svg()