<｜begin▁of▁sentence｜>### Instruction:
Given a set of latent positions generated from a 2-dimensional Dirichlet distribution, how can we simulate both binary and weighted random graphs based on those latent positions using the Random Dot Product Graph (RDPG) model? The binary random graph should not contain self-loops, while the weighted graph should have weights drawn from a Poisson distribution with a mean of 2.
### Response:
import numpy as np
from graspologic.simulations import rdpg

# Generate random latent positions using 2-dimensional Dirichlet distribution.
X = np.random.dirichlet([1, 1], size=5)

# Sample a binary RDPG using sampled latent positions.
A = rdpg(X, loops=False)

# Sample a weighted RDPG with Poisson(2) weight distribution
wt = np.random.poisson
wtargs = {'lam': 2}
A_weighted = rdpg(X, loops=False, wt=wt, wtargs=wtargs)
<|EOT|>
