Independence of Bernoulli Variables if Bernoulli Parameters are Dependent? I have a conceptual question about the effect that dependent random variables have on the independence of other random variables if the dependent random are used as parameters of the other random variables.
For concreteness, suppose we have a sequence of random variables $p_1, p_2, ...$ that follows a random-like walk of $p_n = \min(\max(p_{n-1} + \epsilon_n, 0), 1)$ where $\epsilon_n$ is some small i.i.d. noise e.g. $\epsilon \sim N(0, 0.001)$ and the min and maxes act to ensure $p_n \in [0, 1]$. I then use this sequence of random variables as the parameters for another sequence of binary random variables $q_1, q_2, ...$ where $q_n \sim Bern(p_n)$. My questions are:

*

*Are $q_i$ and $q_j$ for $i \neq j$ independent from one another?

*Are $q_i$ and $q_j$ for $i \neq j$ conditoinally independent from one another given $p_i, p_j$?

Intuitively, it feels like the answers are no and yes, respectively. Is this correct?
 A: To facilitate this analysis, I will use upper and lower-case notation to distinguish random variables and their outcomes.  Consequently, I will depart slightly from your notation.
Whether or not the values are conditionally independent given the underlying probability is up to you --- you need to specify this as part of your model.  Usually, when we write $q_i \sim \text{Bern}(p_i)$ this is a shorthand for a model where we take the values to be conditionally independent given the underlying probability vector, so usually that is what you would be assumed to mean if you write that.  If we assume conditional independence then (formally) we have:
$$\mathbb{P}(Q_1 = q_1,...,Q_n = q_n | \mathbf{P} = \mathbf{p}) = \prod_{i=1}^n \text{Bern}(q_i|p_i) = \prod_{i=1}^n p_i^{q_i} (1-p_i)^{1-q_i},$$
where  $\mathbf{p} = (p_1,...,p_n)$ denotes the vector of probability values for the observable values.  Now assuming you specify that there is conditional independence here, the dependency in the underlying probabilities will still lead to a situation where the observable values are not independent (they will generally be positively correlated).  To get an expression for the joint probability of the observable values, suppose we let $\pi(p_1)$ denote the marginal density of the first probability and let $\eta(p_i|p_{i-1})$ denote the conditional probability density for each subsequent probability.  Applying the law of total probability gives:
$$\begin{align}
\mathbb{P}(Q_1 = q_1,...,Q_n = q_n)
&= \int \mathbb{P}(Q_1 = q_1,...,Q_n = q_n | \mathbf{P} = \mathbf{p}) \cdot \mathbb{P}(\mathbf{P} = \mathbf{p}) d \mathbf{p} \\[6pt]
&= \int \Bigg( \prod_{i=1}^n p_i^{q_i} (1-p_i)^{1-q_i} \Bigg) \Bigg( \pi(p_1) \prod_{i=2}^n \eta(p_i|p_{i-1}) \Bigg) d \mathbf{p} \\[6pt]
&= \int \pi(p_1) p_1^{q_1} (1-p_1)^{1-q_1} \prod_{i=2}^n p_i^{q_i} (1-p_i)^{1-q_i} \eta(p_i|p_{i-1}) d \mathbf{p}. \\[6pt]
\end{align}$$
In the special case where $\eta(p_i|p_{i-1}) = \pi(p_i)$ this expression will reduce down to a product of terms for $q_1,...,q_n$ (establishing independence), but in the general case it does not.
