Texts: stuck. Please don't answer without a strong statistics background.
Let X be the sum of 30 independent Beta random variables, each of which is identically distributed as Beta(4, 2).
Python:
1 import math
2 from scipy import stats
3 N_SUMS = 30
4 N_SIMULATIONS = 100000
6 def sum_betas_simulation():
7 # Return the probability P(19 < X < 20), computed via simulation
8 # TODO: Your code here
9 return
10 def sum_betas_clt():
11 # Return the probability P(19 < X < 20), computed via CLT
12 # TODO: Your code here
13 return
14 def main():
15 # Main is already set up to call the two functions above
16 simulation = sum_betas_simulation()
17 clt = sum_betas_clt()
18 print(f'sum_betas_simulation: {simulation:.3f}')
19 print(f'sum_betas_clt: {clt:.3f}')
20 if __name__ == "__main__":
21 main()
30
X = Σxi, i=1
Where: X ~ Beta(a = 4, b = 2)
Fill in two functions: sum_betas_clt and sum_betas_simulation, which both approximate the probability P(19 < X < 20). Verify that both functions produce (roughly) the same answer to the question. For your numeric answer, give the CLT estimate to three decimal places.
Simulation Estimation:
def sum_betas_simulation():
# Implement sum_betas_simulation so that it simulates 100,000 calculations of X. Use these simulations to estimate P(19 < X < 20)
CLT Estimation:
def sum_betas_clt():
# Run the Central Limit Theorem to come up with an estimating distribution for X.
Sum_betas_simulation: 0.000
Sum_betas_clt: 0.000
Implement sum_betas_clt to estimate P(19 < X < 20) using the CLT distribution. Note that this answer should not change on each run.