= Hannay19()
model = np.arange(0, 24*30, 0.10)
time = LightSchedule.SlamShift()
light = light(time)
light_est = model(time, input=light_est)
trajectory = TwoProcessModel()
sleep_model = sleep_model(trajectory.time, trajectory.states[:,1], light_est)
homeostat
# Where the homeostat is increasing, we are awake where decreasing we are asleep
= np.where(np.diff(homeostat.states[:,0],prepend=0.0) > 0.0, 1.0, 0.0)
wake_predicted = plt.gca()
ax =light_est, threshold=10.0, color='black', alpha=0.5, smooth=False, ax=ax)
Actogram(time, light_vals=wake_predicted, threshold=0.50, color='green', alpha=0.1, smooth=False, ax=ax);
Actogram(time, light_vals'Sleep During a Slam Shift: Twp Process Model'); ax.set_title(
Sleep
Functions to predict sleep
Two Process Model
The below model uses a simple two process model for sleep to take a circadian trajectory and create a prediction of the homeostat (sleep hunger) which increases during wake and decreases during sleep. The steps parameter can be used to force wake, values of that array that are above the threshold will force a wake state.