voting {i3pack}R Documentation

Function to simulate the voting process

Description

Internal function.

Usage

voting(
  voters,
  nominated,
  n_votes,
  gamma_val,
  gamma_rank,
  epsilon,
  free = TRUE,
  closed_primary = FALSE,
  strategic = FALSE,
  strategic_error = 0.05,
  party_pos = NULL
)

Arguments

voters

See simulate_election().

nominated

See simulate_election().

n_votes

See simulate_election().

gamma_val

See simulate_election().

gamma_rank

See simulate_election().

epsilon

Numeric; maximum acceptable ideological distance used in voters' utility function

free

See simulate_election(). Defaults to TRUE.

closed_primary

Boolean: Are voters required to vote for a candidate in the party closest to them in the primary? Defaults to FALSE.

strategic

See simulate_election().

strategic_error

See simulate_election(). Defaults to 0.05

party_pos

Locations of parties in the election in 1d space (-2, 2).

Value

List with two elements:

votes

Matrix with n_votes rows and length(voters) columns, with cells populated with candidate IDs

max_utils

Vector of maximum utilities received by each voter from among all candidates in the election


[Package i3pack version 0.1.0 Index]