I use the following code to calculate the moving average excluding current row by groups. However, I would like to change it to weighted moving average. Is there any way to impr