Conditional probabilities of the parameters I have the following function
$$ x(k) = \sum_{m}^{M} e^{i(U_m k + \beta_m)} $$
Where
$$ i = \sqrt{-1} $$
The $U_m$ values come from a normal distribution and the $\beta_m$ values come from a uniform distribution.
$$ U_m \sim \mathcal{N}(\mu, \sigma^2) $$
$$ \beta_m \sim \mathcal{U}(0, 2 \pi) $$
I want to know the conditional probability of both parameters $\mu$ and $\sigma^2$ with each other.
Something like $p(\mu|x, \sigma^2)$ and $p(\sigma^2|x, \mu)$
I have seen how people do it when $x$ is a random number following a specific distribution. However, how to deal with this sum. I have attempted finding the distribution of the sum inside the function $x$, but I am almost unsuccessful. It can be found here. I know with central limit theorem (when $M$ is large and $\sigma$ is large), the distribution of $x$ is a Gaussian distribution with mean $0$ and standard deviation $\sqrt{M/2}$ for both the real and the imaginary parts. However, how to find the statistics of $x$ when $M$ is still large but with not so big $\sigma$. So there are three cases:

*

*$M$ large and $\sigma$ large - x becomes Gaussian with $\mu_x = 0$ and $\sigma_x = \sqrt{M/2} $ for both real and imaginary


*$M$ large and $\sigma -> 0$, the distribution of $x$ becomes $\delta(1)$.


*$M$ large but $\sigma$ reasonable - I want the distribution of $x$ as a function of $\sigma$ (and possibly $\mu$).
 A: Sinusoidal functions of a normal random variable have a messy distribution and if you add uniform random variables on top of this then the exact distribution will be extremely messy.  Consequently, you are going to have to rely on the central limit theorem here to get anything tractable (which fortunately fits with your queries involving large $M$).  To begin with, we derive the moments:
$$\begin{align}
\text{E}(k) 
&\equiv \mathbb{E}(\cos (U_m k + \beta_m)) \\[12pt]
&= \int \limits_{-\infty}^\infty \int \limits_{0}^{2 \pi} \cos(u k + b) \cdot \text{N}(u|\mu,\sigma^2) \cdot \text{U}(b|0, 2\pi) \ db \ du \\[6pt]
&= \frac{1}{2 \pi} \int \limits_{-\infty}^\infty \text{N}(u|\mu,\sigma^2) \Bigg( \int \limits_{0}^{2 \pi} \cos(u k + b) \ db \Bigg) \ du \\[6pt]
&= \frac{1}{2 \pi} \int \limits_{-\infty}^\infty \text{N}(u|\mu,\sigma^2) \Bigg[ \sin(u k + b) \Bigg]_{b=0}^{b=2 \pi} \ du \\[6pt]
&= \frac{1}{2 \pi} \int \limits_{-\infty}^\infty \text{N}(u|\mu,\sigma^2) \bigg) \times 0 \ du \\[6pt]
&= \frac{1}{2 \pi} \times 0 \\[18pt]
&= 0, \\[24pt]
\text{V}(k) 
&\equiv \mathbb{V}(\cos (U_m k + \beta_m)) \\[24pt]
&= \mathbb{E}(\cos^2 (U_m k + \beta_m)) \\[12pt]
&= \int \limits_{-\infty}^\infty \int \limits_{0}^{2 \pi} \cos^2(u k + b) \cdot \text{N}(u|\mu,\sigma^2) \cdot \text{U}(b|0, 2\pi) \ db \ du \\[6pt]
&= \frac{1}{2 \pi} \int \limits_{-\infty}^\infty \text{N}(u|\mu,\sigma^2) \Bigg( \int \limits_{0}^{2 \pi} \cos^2(u k + b) \ db \Bigg) \ du \\[6pt]
&= \frac{1}{2 \pi} \int \limits_{-\infty}^\infty \text{N}(u|\mu,\sigma^2) \Bigg[ \frac{u k + b}{2} + \frac{\sin(2uk + 2b)}{4} \Bigg]_{b=0}^{b=2 \pi} \ du \\[6pt]
&= \frac{1}{2 \pi} \int \limits_{-\infty}^\infty \text{N}(u|\mu,\sigma^2) \Bigg[ \frac{u k + 2 \pi}{2} - \frac{u k}{2} \Bigg]\ \ du \\[6pt]
&= \frac{1}{2 \pi} \int \limits_{-\infty}^\infty \text{N}(u|\mu,\sigma^2) \times \pi \ du \\[6pt]
&= \frac{1}{2} \int \limits_{-\infty}^\infty \frac{1}{\sqrt{2 \pi \sigma^2}} \cdot \text{N}(u|\mu,\sigma^2) \ du \\[6pt]
&= \frac{1}{2}, \\[24pt]
\text{C}(k) 
&\equiv \mathbb{C}(\cos (U_m k + \beta_m), \sin (U_m k + \beta_m)) \\[24pt]
&= \mathbb{E}(\cos (U_m k + \beta_m) \sin (U_m k + \beta_m)) \\[12pt]
&= \int \limits_{-\infty}^\infty \int \limits_{0}^{2 \pi} \cos(u k + b) \sin(u k + b) \cdot \text{N}(u|\mu,\sigma^2) \cdot \text{U}(b|0, 2\pi) \ db \ du \\[6pt]
&= \frac{1}{2 \pi} \int \limits_{-\infty}^\infty \text{N}(u|\mu,\sigma^2) \Bigg( \int \limits_{0}^{2 \pi} \cos(u k + b) \sin(u k + b) \ db \Bigg) \ du \\[6pt]
&= \frac{1}{2 \pi} \int \limits_{-\infty}^\infty \text{N}(u|\mu,\sigma^2) \Bigg[ \frac{\sin^2(u k + b)}{2} \Bigg]_{b=0}^{b=2 \pi} \ du \\[6pt]
&= \frac{1}{2 \pi} \int \limits_{-\infty}^\infty \text{N}(u|\mu,\sigma^2) \times 0 \ du \\[6pt]
&= 0. \\[6pt]
\end{align}$$
For large $M$ it follows from the central limit theorem that:
$$\begin{bmatrix} \text{Re}(x(k)) \\ \text{Im}(x(k)) \end{bmatrix}
= \begin{bmatrix} \sum_{m=1}^M \cos (U_m k + \beta_m) \\ \sum_{m=1}^M \sin (U_m k + \beta_m) \end{bmatrix}
\overset{\text{approx}}{\sim} \text{N} \bigg( \mathbf{0}, \frac{M}{2} \mathbf{I} \bigg).$$
This gives you a large-sample approximate sampling distribution for $x(k)$.  We can see that the parameters $\mu$ and $\sigma$ do not affect this sampling distribution, so we then have:
$$\begin{align}
p(\mu|\sigma, x) \approx p(\mu|\sigma), \\[6pt]
p(\sigma|\mu, x) \approx p(\sigma|\mu), \\[6pt]
\end{align}$$
Consequently, for large $M$, these conditional distributions are fully dependent on your prior distribution for the parameters and are barely affected by observation of $x(k)$.  We say that the observations are asymptotically independent of the parameters as $M \rightarrow \infty$.
