I have a question regarding conditional distributions and simulation.
Assume you have a random vector of dimension $n$ with distribution $\pmb{Z}\sim N_n(0,\Sigma)$ where $\Sigma_{ii} = 1$, so each component is such that $Z_i \sim N(0,1)$. Now, we have another variables $X_i$ such that $X_i = f(Z_i) \sim Ber(p_i(Z_i))$. So, to simulate each $X_i$ what I did was simulate the vector $\pmb{Z}$ and use the fact that I know the distribution of $X_i | Z_i$.
My question is, why can't I simulate directly from the marginal of each $Z_i$? This is, simulate $Z_i = z$ from the standard normal, then simulate $X_i|Z_i$. Is the conditioning actually on the whole vector?
Finally, if I want to calculate the marginal distribution of $X_i$, can I use the law of total probability conditioning only on $Z_i$ or do I need to condition on the whole vector? This is, is it correct to calculate $$ f_{X_i}(x) = \int_{\mathbb{R}} f_{X_i|Z_i}(x|z)f_{Z_i}(z)dz $$
EDIT:
My question is more abstract than what I explained here. Basically, assume $X_i = f(Y_i)$, and also $Y_i$ is part of a vector $\pmb{Y}$. If I want to find the unconditional distribution of $X_i$, do I have to use $X_i |\pmb{Y}$ or can I use only $X_i|Y_i$ given that $X_i$ depends only on $Y_i$, even though $Y_i$ is related to the other components of $\pmb{Y}$.