Question: As mentioned in class, the kernel density estimate is just the sum of a bunch of copies of the kernel, each centered on our data

As mentioned in class, the kernel density estimate is just the sum of a bunch of copies of the kernel, each centered on our data points. For those of you familiar with the idea of "convolution", the KDE is simply the convolution of the kernel with the data. The default kernel used by the distplot function is the Guassian kernel, given by: exp(-Gr-z)2 22 22 In Python code, this function is given as below, where alpha is the parameter , z is the x coordinate of the center of the Gaussian (i.e. a data point), and x is the independent variable. The function header is given below. Complete the function body using the formula above. You might find function such as np.exp can be helpful # BEGIN SOLUTION def gaussian_kernel (alpha, x, z): ## END SOLUTION
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
