Exercise 3.16 - Setting the beta hyper-parameters II

Answers

import math 
m=0.15 
l=0.05 
u=0.3 
MC=1000 
delta=(u-l)/MC 
def pm(a2): 
   a1=a2*m/(1-m) 
   pivot=l 
   mass=0 
   B=math.gamma(a1)*math.gamma(a2)/math.gamma(a1+a2) 
   for i in range(MC): 
       pivot=pivot+delta 
       mass=mass+pivot**(a1-1)*(1-pivot)**(a2-1) 
   mass=mass*delta/B 
   return mass

The result of which is better demonstrated through the graph:

PIC

Figure 1: Exercise 3.16.

So the optimal choice is α = 26 . This is tantamount to adopt 32 extra samples.

User profile picture
2021-03-24 13:42
Comments