# Sum of function of normally distributed values

I have a given number, $v$, given by $$v = \sum_{i=1}^N\left\{v_i \cdot \left[m \cdot \left(1 - b_i \cdot \mathbb{1}_{\geq w}(v_i)\right) - b_i \cdot \mathbb{1}_{< w}(v_i) \right] - a \cdot \mathbb{1}_{\geq w}(v_i) \right\}$$ where all the $v_i$ are normally distributed, $v_i \sim \mathcal N(\mu,\sigma^2)$ with $\mu$ and $\sigma$ known, and $N$, $m$, $\mathbf{b}$, $w$, and $a$ are known constants (with $\forall i :b_i\in \{0,1\}$). What is the pdf $p(v|N,m,\mathbf{b},w,a, \mu, \sigma)$?

Now suppose $N$ is not known but rather Poisson distributed with rate $\lambda$ and $b_i$ has a known pdf $p(b_i|v_i)$, what's $p(v|m,w,a,\mu,\sigma,\lambda)$?

More generally, given a variable $$x = \sum_{i=1}^N f(x_i)$$ where $x_i \sim \mathcal N(\mu,\sigma^2)$, is there a standard way to derive $p(x|N,f(\cdot),\mu,\sigma)$?

Here's something to get you started with your 'general' question (I'm very curious to see what others might say too). If you've got a random variable $X$ with pdf $f$ and you want the distribution of $g(X)$ for some transformation $g$, then one thing to try is to use the Jacobian theorem. Another thing that you could do is to appeal to the law of the unconscious statistician and compute the characteristic function $\phi_{g(X)}(t)$ of $g(X)$ via $$\phi_{g(X)}(t) = \mathbb E(e^{it g(X)}) = \int_{\mathbb R} e^{it g(x)} f(x)dx.$$
Now let's say we have $X_1, \dots, X_n \sim_{iid} f$ and we want the distribution of $Y := \sum_{i=1}^n g(X_i)$. Using characteristic functions and appealing to independence we have that $$\phi_Y(t) = \phi_{g(X_1) + \dots + g(X_n)}(t) = \prod_{i=1}^n \phi_{g(X_i)}(t) = \left( \phi_{g(X_1)}(t) \right)^n$$
and we have already worked out $\phi_{g(X_1)}(t)$ in the first part (the last equality is because of the identical distribution assumption). This is the main advantage to using characteristic functions: you'll probably want to use them for the summation, so you might as well just bite the bullet and compute $\phi_{g(X_1)}(t)$ up front.
Here's an example: suppose that $X_1, \dots, X_n \sim \ \text{iid} \ \mathcal N(0,1)$ and let $g(X) = X^2$, so that $Y = \sum_{i=1}^n X_i^2$, which we know to be $\chi^2_n$.
We can work out that $$\phi_{X_1^2}(t) = \frac{1}{\sqrt{2\pi}} \int_{\mathbb R} \exp \left( -\frac{x^2}{2}(1 - 2it)\right)dx = (1-2it)^{-\frac{1}{2}}$$ which is indeed the CF of a $\chi^2_1$ random variable. This means that $$\phi_Y(t) = \phi_{X_1^2}(t)^n = (1-2it)^{-\frac{n}{2}}$$ which is the CF of $\chi^2_n$. You can confirm these CFs here.