I am trying to smooth some binned data. I have a discrete variable X which might best be thought of as time and a continuous variable Y. I want to know the average Y value for each value of X and this is pretty straight forward. However, if some specific X values have few associated Y values I suffer from high statistical error. I would like to smooth the averages by using the support from their adjacent bins.
An example might be illustrative. Let Y be days and X be sale price from a retail store. If I want to know the average sale price trend over time this can be easily calculated. However if there are days where only one or two items were sold they could cause the plot to fluctuate wildly. I would like to reduce statistical error on each day by incorporating the adjacent few days. I assume there are a number of ways to do this so please let me know if there is a standard.
Please note I do not want to interpolate. I just want to control the statistical fluctuations. Also, the most recent day is likely of the most importance. Since this day only has bins on one side of it I suspect a bias from many methods. Is there a way to add an error bar to the adjusted average in a meaningful way?
It seems there are many methods available so I will describe my situation to make it more clear. We are calculating a price index at a car dealership. All sale values are negotiated so we can use this to understand market trends. Many cars are unique so we do not have an apples to apples comparison over time. This prevents a standard "Market Basket" approach. We have a machine learning model which predicts the sale price. We then make a partial dependence plot by predicting all cars ever sold at each time interval. The average of all cars at each time gives the price index. This is just the standard partial dependence in time but has this useful implication. Anyway, there are some fluctuations which come from the model. In some time periods few cars were sold so we would want to smooth dependent on the training data volumes. The averages themselves actually all have the same number of data points since it is a partial dependence plot.