<｜begin▁of▁sentence｜>### Instruction:
Given the adjacency matrix of an undirected graph representing social interactions between 4 individuals, how can you use the RDPGEstimator from graspologic to model the graph and sample a new graph with a similar structure?
### Response:
import numpy as np
from graspologic.models import RDPGEstimator

# Define an adjacency matrix for an undirected graph
adjacency_matrix = np.array([
    [0, 1, 0, 0],
    [1, 0, 1, 1],
    [0, 1, 0, 1],
    [0, 1, 1, 0]
])

# Initialize the RDPGEstimator
rdpg_estimator = RDPGEstimator(loops=False, n_components=2)

# Fit the estimator to the adjacency matrix
rdpg_estimator.fit(adjacency_matrix)

# Sample a new graph from the fitted model
sampled_graph = rdpg_estimator.sample(n_samples=1)

# The sampled graph is a numpy array adjacency matrix
print('Sampled Graph:\n', sampled_graph[0])
<|EOT|>
