| simula_BPF | R Documentation |
Generates a set of RxC tables with the joint distribution of voters in two elections according to the model proposed by Forcina et al. (2012), an extension of Brown and Payne (1986), under the assumption that transition probabilities are homogeneous across units. The simulation procedure is detailed in Pavia and Forcina (2026). Results for the first election may be provided by the user or simulated according to the overdispersed multinomial model.
simula_BPF(
n.units,
TM,
prop1,
polling.sizes,
theta1 = 0.1,
theta2 = 0.1,
cs = 50,
noise = 0,
simplify = FALSE,
...
)
n.units |
Either a positive integer, |
TM |
A row-standardized RxC matrix with the underlying global transition probabilities of the simulated elections. If the matrix is not row-standardized, it is internally row-standardized by the function. |
prop1 |
A vector of length R with the initial assumed probabilities of voting (to be simulated) for each of the R competing options in the first election. If the provided vector is not a set of probabilities (i.e., a vector of positive numbers adding to 1), it is internally standardized by the function. |
polling.sizes |
Either a vector of two components with two positive integer
numbers indicating the minimum and maximum number of voters
for each unit or a vector of length |
theta1 |
A number between 0 and 1 used as the overdispersion parameter.
This parameter is employed by the underlying Dirichlet distribution,
in conjunction with |
theta2 |
Either a single number between 0 and 1 or a vector of length |
cs |
A positive number indicating the average number of cluster size. Default, |
noise |
Either a single number between 0 and 1 or a vector of length |
simplify |
A TRUE/FALSE argument indicating whether the simulated RxCxK array of counts by polling unit should be rearranged as a matrix of order Kx(RC). Default, FALSE. |
... |
Other arguments to be passed to the function. Not currently used. |
A list with the following components
votes1 |
A |
votes2 |
A |
TM.global |
An |
TM.units |
An |
inputs |
A list containing all the objects with the values used as arguments by the function. |
Antonio Forcina, forcinarosara@gmail.com
Jose M. Pavia, pavia@uv.es
Brown, P. and Payne, C. (1986). Aggregate data, ecological regression and voting transitions. Journal of the American Statistical Association, 81, 453–460. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1080/01621459.1986.10478290")}
Forcina, A., Gnaldi, M. and Bracalente, B. (2012). A revised Brown and Payne model of voting behaviour applied to the 2009 elections in Italy. Statistical Methods & Applications, 21, 109–119. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1007/s10260-011-0184-x")}
Pavia, J.M, and Forcina, A. (2026). Simulating electoral behavior. In Modeling Decisions for Artificial Intelligence, MDAI 2025. Lecture Notes in Computer Science, vol 15957, Torra, V., Narukawa, Y., Domingo-Ferrer, J. (eds), Springer, Cham, pp. 54-65. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1007/978-3-032-00891-6_5")}
simula_BPF_with_deviations simula_mixture
TMg <- matrix(c(0.6, 0.1, 0.3, 0.1, 0.7, 0.2, 0.1, 0.1, 0.8),
byrow = TRUE, nrow = 3)
example <- simula_BPF(n.units = 100, TM = TMg, prop1 = c(0.3, 0.3, 0.4),
polling.sizes = c(750, 850))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.