twitter_ABM: Agent-based model

View source: R/twitter_ABM.R

twitter_ABMR Documentation

Agent-based model

Description

An agent-based model (ABM) of cultural transmission on Twitter that incorporates content bias, frequency bias, demonstrator bias, and the level of age-dependent selection.

Usage

twitter_ABM(
  N = 1000,
  overall_activity,
  cont_bias = 0,
  dem_bias = 0,
  freq_bias = 1,
  age_dep = 1,
  obs_user_data,
  obs_init_tweets,
  sum_stats_TF = TRUE,
  diversity_TF = FALSE
)

Arguments

N

Overall population size.

overall_activity

A vector of the total of number of tweets and retweets in each timestep. The length of this vector is used to determine the number of timesteps.

cont_bias

Variation in the salience of the attractiveness of content (only positive values, where 0 is neutrality).

dem_bias

Variation in the salience of the follower count (only positive values, where 0 is neutrality).

freq_bias

Level of frequency bias (only positive values, where < 1 is novelty and > is conformity).

age_dep

Rate of decay in age-dependent selection.

obs_user_data

A data frame of the observed activity levels, probability of writing an original tweet as opposed to retweeting (mu), and the follower count for each user.

obs_init_tweets

A data frame of the observed retweet frequencies from the first timestep and the user the original tweets were from (the row of the corresponding user in obs_user_data).

sum_stats_TF

Whether you want to simplify the raw data to the following summary statistics: (1) the proportion of tweets that only appear once, (2) the proportion of the most common tweet, (3) the Hill number when q = 1 (which emphasizes more rare tweets), and (4) the Hill number when q = 2 (which emphasizes more common tweets) (TRUE/FALSE).

diversity_TF

Whether you want to return the Simpson's diversity index from each timepoint (TRUE/FALSE).

Value

Returns one object or a list of two objects, depending on the values for sum_stats_TF and diversity_TF.


masonyoungblood/TwitterABM documentation built on March 28, 2023, 3:17 p.m.