Supongamos que tengo $n$ independiente de variables aleatorias normales
$$X_1 \sim \mathrm{N}(\mu_1, \sigma_1^2)\\X_2 \sim \mathrm{N}(\mu_2, \sigma_2^2)\\\vdots\\X_n \sim \mathrm{N}(\mu_n, \sigma_n^2)$$
and $Y=X_1+X_2+\dotsm+X_n$. How would I characterize the density of $S$ if the distribution of each $X_i$ is each truncated to within $(\mu_i - 2\sigma_i, \mu_i + 2\sigma_i)$? In other words, I'm sampling from $n$ independent normal distributions, discarding samples not within $2\sigma_i$ of each mean, and summing them.
Right now, I'm doing this with the R code below:
x_mu <- c(12, 18, 7)
x_sd <- c(1.5, 2, 0.8)
a <- x_mu - 2 * x_sd
b <- x_mu + 2 * x_sd
samples <- sapply(1:3, function(i) {
return(rtruncnorm(100000, a[i], b[i], x_mu[i], x_sd[i]))
})
y <- rowSums(samples)
Is there any method for generating the density of $$ Y directamente?