I am working on propensity score matching using the Kernel Nadaraya–Watson kernel regression. But I am looking to understand the logic of estimation; First, we estimate the Kernel density of each unit (i) in the data using the formula
$$ \hat Y_{0i} = \frac{\sum_{E_0} K\left(\left\| \tfrac{X_i-X_k}{h} \right\|\right) Y_k}{\sum_{E_0} K\left(\left\| \tfrac{X_i-X_k}{h} \right\|\right)} $$
Next, to predict the output for new input X=50, we find the weights that the Gaussian of each data point xi has in the prediction. This can be visualized as the y-axis values corresponding to where the vertical line of x=50 intersects the various Gaussians. This is given below. Finally, we multiply the weight vector w with the label vector y and take its average.
The formula implies that we estimate the kernel density of a distance between two points, but in practice, we estimate the kernel density of each point (i) in the data. So I am dazed, I am looking to understand this aspect of the formula (I have an ambiguous understanding).