A system and method are provided for modulating the base rate of a transfer function for a rate-responsive cardiac pacemaker. Activity sensor measurements are used to derive activity variance measurements, which in turn are used to modulate the base pacing rate. In one embodiment, a histogram is used to store activity variance measurements collected over a period of about a week. The histogram is used to derive an activity variance threshold, which is compared to current activity variance measurements to determine if the patient is sleeping. If the patient is deemed to be sleeping, the pacing rate is set to a rate that comfortably meets the patient's low metabolic demands during sleep. In alternative embodiments, the activity variance measurements are applied to a base rate slope to modulate the base pacing rate.