Time‐varying exposure and the impact of stressful life events on onset of affective disorder