Is this related to mating? Having hunted and observed squirrels for nigh on to 70-years, my unscientific explanation on the relation of tail shaking to mating, is that tail shaking is totally coincidental to mating. Squirrels (including pineys) shake their tails to emphasize the sounds they produce. Tail-shaking--as barking--is a manner of scolding intruders and warning other squirrels of the intruders. When a fox squirrel is in doubt about something it sees or hears it tends to vent its ire by barking and shaking its tail. When a squirrel is barking, its tail will most often be flipping like a buggy whip. When a gray squirrel sees or hears something strange it merely gets out of there. Incidentally, fox and gray squirrels flip their tails up and down when they are curious or angry with an intruder. Piney squirrels flip their tails up and down, but when they want to really vent their ire they may flip their tails from side to side or in a 365 degree circle.