Search for question
Question

2- For the following synthetic data and quadratic model: import numpy as np import matplotlib.pyplot as plt np.random.seed (123) #Choose the "true" parameters for a quadratic model. a_true = 0.1 b_true = -1.0 c_true = 3.0 f_true = 0.5 # Generate some synthetic data from the quadratic model. N = 50/nx = np.sort (10* np.random.rand (N)) yerr 0.1 +0.5* np.random.rand (N) y = a_true * x**2 + b_true * x + c_true - y += np.abs (f_true * y) np.random.randn (N) y += yerr np.n random.randn (N) = * # Create a scatter plot with error bars plt.errorbar (x, y, yerr-yerr, fmt=".k", capsize=0) * # Generate the quadratic curve based on the "true" parameters x0 = np.linspace (0, 10, 500) y0 = a_true * x0**2 + b_true * x0 + c_true #Plot the quadratic curve plt.plot (x0, y0, "k", alpha=0.3, 1w=3) plt.xlim (0, 10) plt.xlabel ("x") plt.ylabel("y") # Show the plot plt.show()/ny 5 + 3 2 1 0- 0 2 #F₁ 8 10 Redo all the steps in the Generative Probabilistic Model section. Use these uniform priors for model parameters (0<a<3, -6<b<6, 2<c<5, and -2<f<2): (8 points)

Fig: 1

Fig: 2

Fig: 3