Week 6: Truncation Functions
April 24, 2024
Once again, welcome back to my blog. Last week, I was able to decide on how I wanted to generate the preference profiles, opting to use a spatial generation model with 4, 5, 6, and 7 candidates, voter populations of 100, 200, 300, 400, 500, 600, and 2000, and dimensions of 2, 3, and 4. Once the complete profiles are generated, I need to be able to truncate them probabilistically to model realistic voting patterns and uniformly in order to mimic forced ballot truncation. This week I dedicated my time to creating these truncation methods.
The majority of the work for the probabilistic truncation function was done within the first two weeks of this project when I generated the probability distributions. If you recall, I generated different probability distributions for elections with each number of candidates(ie. One for elections with 4 candidates and another for elections with 5 candidates). Since that was already complete, I just had to write a function to truncate the preference profiles based on those distributions. The function works by iterating through every ballot in the preference profile, each time truncating the ranking to a somewhat random length (based on a number generated from the probability distribution).
The next method that I wrote this week was to truncate the profiles uniformly, meaning that the ballots all get sliced down to the same, specified length. The function takes in two parameters: a preference profile and the length of the ballot to truncate down to. It then iterates through every ballot and removes the candidates that were ranked behind the specified length. If the ballot is already shorter than the specified length, then the ballot stays the same. For this reason, not every ballot in the resulting profile will necessarily be of uniform length.
Now that these two functions are complete, I can start putting together the simulation, which is what I’ll be doing next week. Don’t miss it!
Leave a Reply
You must be logged in to post a comment.