Help! I just spent the last hour fiddling with spreadsheets instead of studying for my comprehensive.
Anyhow, I've created a spreadsheet that compares gauss cannons of all sizes using available hull size and RoF, calculating chance to hit at least once and average number of hits per salvo (assuming no bonuses or maluses based other than those in the design screen, e. g. ECM or commander accuracy). Also, these results assume that the percentages displayed in the design screen are correct, rather than approximate.
High level overview
For RoF 1, the results are slightly tricky. Because of certain break-points in accuracy vs. size, HS 5 and HS 1 Gauss cannons appear to be the 'best' - that is, give the highest number of hits on average. (If what you need instead is at least one hit, you're better off going with the largest gun that will fit evenly in your space. )
However, for RoF 2 and above, HS 0. 5 gauss cannons are clearly the best. (In some small HS allotments, you could argue that the increased chance to hit at least once favors 1 or 1. 5 size gauss cannons - if the enemy's not shooting a lot at you). They have far and away the highest average number of hits. (In fact, it gets so high at RoF 4 I'm questioning why I ever built AMMs in the first place. )