set.seed(2223)
n <- 10000
# Generating synthetic data on a matrix with 2 columns.
X <- cbind(
age = sample(1:100, n, replace = TRUE),
female = sample.int(2, n, replace = TRUE) - 1
)
adopt_chatgpt <- ModelDiffNet(
"ChatGPT",
prevalence = .01,
prob_adopt = .1,
data = X,
params = c(1, 4)
)
# Simulating a population from smallworld
agents_smallworld(adopt_chatgpt, n, 8, FALSE, .01)
# Running the model for 50 steps
run(adopt_chatgpt, 50)
# Plotting the model
plot(adopt_chatgpt)
Run the code above in your browser using DataLab