# How to choose the best method to generate random values [closed]

In my specific case, I have a pdf that has no closed form, and I want to generate random values ​​of this distribution. It depends on a summation that goes to infinity (coming from a poisson process) and two Lebesgue integrals. Can anyone tell me how to choose a suitable method to generate random values ​​from this distribution?

Here is my pdf for a finite collection of points $$r=(s_1,\dots,s_n)$$. $$p(Y_r)=\sum^{\infty}_{|N|=0}\frac{{\rm e}^{-\lambda\mu(S)}\left[\lambda \right]^{|N|}}{|N|!}\int_{S^{|N|}}\int_{\mathbb{R}^{|N|}}f_N(Y_N\mid S_N,N)p(Y_r\mid Y_N,S_N)\text{d}Y_N\text{d}S_N$$,

where $$f_N(Y_N\mid S_N,N)$$ is a normal distribution $$|N|$$-dimensional, and $$p(Y_r\mid Y_N,S_N)$$ is a conditional normal distribution $$n$$-dimensional. Here $$S_N$$ is the vector of locations of the points from my Poisson process ($$N$$).

I want generate values for $$Y_r$$.

## closed as unclear what you're asking by Xi'an, user158565, Michael Chernick, mkt, kjetil b halvorsenMay 16 at 9:18

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

• This remains unclear: any connection between $r$ and the index of $Y_r$? how are the normal densities conditional on $N$ and $S_N$ defined? Why is it impossible to integrate the inner integral since Normal x Normal is manageable? – Xi'an May 15 at 20:23
• For your first question is yes. For the second, it's a normal distribution $|N|$-dimensional, where $|N|$ is the number of points of the Poisson process $N$. $Y_N|S_N,N\sim(a, \Sigma^2)$ where $a$ is a $|N|$-vector of constants and $\Sigma^2$ is the covariance matrix depending on the locations. It is 'impossible' to solve the last integral because it's with respect to locations. – Ga13 May 15 at 20:31

From the representation $$\sum^{\infty}_{|N|=0}\frac{{\rm e}^{-\lambda\mu(S)}\left[\lambda \right]^{|N|}}{|N|!}\int_{S^{|N|}}\int_{\mathbb{R}^{|N|}}f_N(Y_N\mid S_N,N)p(Y_r\mid Y_N,S_N)\text{d}Y_N\text{d}S_N$$one can spot $$\underbrace{\sum^{\infty}_{|N|=0}}_\text{marginal in N}\overbrace{\frac{{\rm e}^{-\lambda\mu(S)}\left[\lambda \right]^{|N|}}{|N|!}}_{\text{Poisson distributions on N}}\underbrace{\int_{S^{|N|}}\int_{\mathbb{R}^{|N|}}}_\text{marginal in Y_N,S_N}\overbrace{f_N(Y_N\mid S_N,N)}^\text{generation of Y_N}\underbrace{p(Y_r\mid Y_N,S_N)}_\text{generation of Y_r}\text{d}Y_N\text{d}S_N$$ Hence this means that, if one
1. Generate a Poisson $$|N|\sim\mathcal P(\lambda)$$
2. Generate $$S_N$$ conditionally on $$N$$ [I am unclear how]
3. Generate $$Y_N$$ as a Normal conditionally on $$S_N$$
4. Generate $$Y_r$$ as a Normal conditionally on $$Y_N,S_N$$
• Yes, producing $Y_r$ from the marginal is equivalent to producing the quadruple from the joint and extracting $Y_r$. – Xi'an May 31 at 4:42