<div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-family:trebuchet ms,sans-serif;font-size:small"><br></div></div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jan 11, 2022 at 2:32 PM Daniel Carrera <<a href="mailto:dcarrera@gmail.com">dcarrera@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><div style="font-family:"trebuchet ms",sans-serif;font-size:small"><br></div></div><div style="font-family:"trebuchet ms",sans-serif;font-size:small">Impartial culture: 15 voters, 3 candidates:<br></div><div style="font-family:"trebuchet ms",sans-serif;font-size:small"><br></div><div style="font-family:"trebuchet ms",sans-serif;font-size:small"><span class="gmail_default" style="font-family:"trebuchet ms",sans-serif;font-size:small"></span>Your result: <span class="gmail_default"></span><span style="font-family:Arial,Helvetica,sans-serif">0.1101-0.1191</span></div><div style="font-family:"trebuchet ms",sans-serif;font-size:small"><span style="font-family:Arial,Helvetica,sans-serif">My result: ~0.06</span></div><div style="font-family:"trebuchet ms",sans-serif;font-size:small"><br></div><div style="font-family:"trebuchet ms",sans-serif;font-size:small">So I'm still off by a fair bit, but at least now I'm in the correct magnitude range. I'm going to look around to see if I find another bug.</div></div>
</blockquote></div><div class="gmail_default" style="font-family:"trebuchet ms",sans-serif;font-size:small"></div><div class="gmail_default" style="font-family:"trebuchet ms",sans-serif;font-size:small">Aha! I had the `SS += 1` vs `SF += 1` counter in the wrong loop. Using your pseudocode:</div><div class="gmail_default" style="font-family:"trebuchet ms",sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:"trebuchet ms",sans-serif;font-size:small">for n = 1...numiters:<br> e_A = sample election<br> w_A = winner of e_A according to method M<br> for c_k in every candidate but w_A:<br> for i = 1...strategy_iters:<br> ...<br> if strategy successful:<br> increment number of strategy successes SS<br> else:<br> increment number of strategy failures SF<br></div><div class="gmail_default" style="font-family:"trebuchet ms",sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:"trebuchet ms",sans-serif;font-size:small">I had the if statement in the `for c_k in every ...` loop. Moving it back down where it belongs gives me strategy success rates in the same range as yours.</div><div class="gmail_default" style="font-family:"trebuchet ms",sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:"trebuchet ms",sans-serif;font-size:small">Your result: 0.1101-0.1191 (95% c.i.)<br>My result: 0.0923-0.1250 (95% c.i.)</div><div class="gmail_default" style="font-family:"trebuchet ms",sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:"trebuchet ms",sans-serif;font-size:small">It is comforting that my interval contains yours. The wider interval probably just reflects that I'm using fewer elections because I'm testing the code. I'm running sets of 1,000 elections and the paper uses 10,000.</div><div class="gmail_default" style="font-family:"trebuchet ms",sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:"trebuchet ms",sans-serif;font-size:small">Thanks for the help!</div><div class="gmail_default" style="font-family:"trebuchet ms",sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:"trebuchet ms",sans-serif;font-size:small">Cheers,</div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><font face="trebuchet ms, sans-serif">Dr. Daniel Carrera</font></div><div dir="ltr"><font face="trebuchet ms, sans-serif">Postdoctoral Research Associate</font></div><div><font face="trebuchet ms, sans-serif">Iowa State University</font></div></div></div></div></div></div></div></div></div></div></div>