# Prediction interval for sum of weighted bernoulli random variables with estimated probability p

Suppose $$X_1,...,X_n$$ are independent bernoulli random variables with success parameter $$p$$, i.e. the common pmf is $$f(x)=p^x (1-p) ^{1-x}$$ for $$x=1$$ or $$x=0$$. I am interested in finding a prediction interval of the weighted sum $$Y=\sum_{i=1}^nw_iX_i,$$ where $$w_i>0$$ are deterministic weights.

I do not know the underlying probability $$p$$, but I do have an estimator $$\hat{p}$$ whose standard deviation $$s$$ is known. Suppose also that my estimator $$\hat{p}$$ is unbiased for $$p$$. I believe it follows that the random variable $$\tilde{X}_i$$ with success probability $$\hat{p}$$ is unconditionally distributed the same as $$X_i$$, take for example $$\hat{p}$$ to be Beta distributed with parameters that imply a mean of $$p$$ and calculate $$\int f(x|\hat{p}) f_2(\hat{p}) d \hat{p}$$, where $$f_2$$ is the pdf of the beta distribution with implied mean $$p$$. Therefore, I could simply use

$$\tilde{Y}=\sum_{i=1}^nw_i\tilde{X}_i$$ to construct a prediction interval for $$Y$$ by simulation of $$\tilde{Y}$$ or by a central limit theorem approximation for $$\tilde{Y}$$. While this confidence interval is correct unconditionally, I feel it is quite awkward because it doesnt incorporate that my estimator $$\hat{p}$$ is quite variable. Is there also a way to incorporate the standard deviation $$s$$ of my estimator (in case I also know the distribution of $$\hat{p}$$) to construct a prediction interval for $$Y$$?

• Are you looking for a confidence interval on the expectation of $Y$, or for a prediction-interval on $Y$? There is a difference. Sep 8, 2022 at 10:13
• @StephanKolassa I am referring to the construction of a random interval $[L, U]$ such that $P(Y \in [L, U])$ is equal to a pre-specified probability. Since $Y$ is not a parameter I think I should technically refer to this as a prediction interval. Sep 8, 2022 at 10:22
• Yes, that is precisely a prediction interval. Do you want to update your post and the tags? Sep 8, 2022 at 10:30