Convexity and Large Deviations