Answered step by step
Verified Expert Solution
Question
1 Approved Answer
This is my previous function Product of Gaussians II You can verify the results of the numerical experiment with mathematical analysis: e-a(z-A)? x e-B(zB)? =
This is my previous function
Product of Gaussians II You can verify the results of the numerical experiment with mathematical analysis: e-a(z-A)? x e-B(zB)? = Ke-Y(z-C)? aA + BB where K = exp (A - B)2 ) 7=a + B and C= a+B Adapt your previous function to plot this analytic result along with the other three curves. erp ( a+B [1] from matplotlib import pyplot as mp import numpy as np # defininig gaussian function, return numpy array containg gaussian distribution # with mean as mu and standard deviation as sig def gaussian(x, mu, sig): return np.exp(-np.power (x - mu, 2.) / (2 * np.power (sig, 2.))) # creates a linspace x_values = np.linspace (-7.5, 7.5, 500) # creates the gaussian vector gl and g2 gl = gaussian (x_values, -1, 1) 92 = gaussian (x_values, 0, 2) # multiply gl and g2 g3 np.multiply(g1,g2) # plotting mp.plot(x_values, gl) mp.plot(x_values, g2) mp.plot(x_values, g3) mp.show() = Product of Gaussians II You can verify the results of the numerical experiment with mathematical analysis: e-a(z-A)? x e-B(zB)? = Ke-Y(z-C)? aA + BB where K = exp (A - B)2 ) 7=a + B and C= a+B Adapt your previous function to plot this analytic result along with the other three curves. erp ( a+B [1] from matplotlib import pyplot as mp import numpy as np # defininig gaussian function, return numpy array containg gaussian distribution # with mean as mu and standard deviation as sig def gaussian(x, mu, sig): return np.exp(-np.power (x - mu, 2.) / (2 * np.power (sig, 2.))) # creates a linspace x_values = np.linspace (-7.5, 7.5, 500) # creates the gaussian vector gl and g2 gl = gaussian (x_values, -1, 1) 92 = gaussian (x_values, 0, 2) # multiply gl and g2 g3 np.multiply(g1,g2) # plotting mp.plot(x_values, gl) mp.plot(x_values, g2) mp.plot(x_values, g3) mp.show() =Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started