Well, do the math.
Take mil 8 as a baseline, cav shock modifier is 1.8, no fire, artillery fire is 1.0, negligible shock. Assuming equal rolls, the cavalry will deal 3.6 times the damage of any artillery. (Remember, artillery deal half damage when they're in the back row) So adding on one cavalry will give me 4 artillery worth of damage. So if I can add more troops onto the front line, cavalry is always better, hands down.
But, assuming the CW is full, what's the difference between adding 1 artillery, or substituting 2 cavalry in for 2 infantry (Assuming we're not yet at the insufficient support point yet) Both are the same cost in money. Infantry have .5 fire and .85 shock. Every 2 phases, the artillery does .5 units of damage, while the 2 cavalry do .9 units of damage. Still, almost twice the damage of adding artillery.
Gets more complicated though when you consider pips. If you have heavy fire, artillery can perform substantially better, but I personally still trust cavalry, especially as I wouldn't have to worry about having my artillery ever getting to the front line, where they get massacred.