Statistical Physics Of Modulated Phases In Nematic Liquid Crystals