This question is about creating a prediction interval for the mean of predictions from a regressor.
Let's say I have arbitrary regression function (not necessarily parametric, could be random forest, etc.) $f: X\mapsto\hat{y}$ which yields predictions $\hat{y} = f(X)$. I also know $y_{true}$ for a training set, which allows me to calculate an estimate for $R^2$ score, $MSE$, etc. However, I'm not actually interested in the individual $\hat{y}$ values, but rather their mean, $mean(\hat{y})$.
Is there any way to use my comparison between $\hat{y}$ and $y_{true}$ above for the training set to then estimate a prediction interval for $mean(\hat{y})$ for a testing set where $y_{true}$ is unknown? My intuition is that the prediction interval for the mean of predictions should be narrower than the interval for an individual prediction, but I'm not sure how move from this intuition into an actual prediction interval, especially on a non-parametric model. Any help would be appreciated.