Welcome to twoprocessmodel’s documentation!

Two process model

The two process model uses two processes and an additional noise process.

More information about the circadian process or the two process model can be found in the following academic research papers:

[1] S. Daan, D. G. Beersma, and Alexander A. Borbély. 1984. Timing of Human Sleep: Recovery Process Gated by a Circadian Pacemaker. American Journal of Physiology - Regulatory, Integrative and Comparative Physiology 246, 2 (Feb. 1984), R161–R183.

[2] Alexander A. Borbély and Peter Achermann. 1999. Sleep Homeostasis and Models of Sleep Regulation. J Biol Rhythms 14, 6 (Dec. 1999), 559–570. https://doi.org/10.1177/074873099129000894

Circadian process

Implements the class to model the circadian process of the two process model.

class circadianProcess.CircadianProcess(A=0.12, tau=24.0, t0=8.6)

Implements the circadian process of the two process model.

sample(t)

Samples circadian process value at time t.

Parameters:t – Time at which the circadian process should be sampled in hours.
Returns:Circadian phase at time t.

Homeostatic process

Implements the class to model the homeostatic process of the two process model.

class homeostaticProcess.HomeostaticProcess(tau_d=4.2, tau_r=18.2, d_t=0.5, S_init=0.5)

Implements the homeostatic process to model sleep pressure.

Maximum sleep pressure is 1, minimum is 0.

sample(sleeping)

Draw the next sample from the homeostatic process.

Parameters:sleeping – Whether the subject is currently sleeping (1) or not (0).
Returns:S Value of homeostatic process.

Noise process

Implements tests for the noise process.

class noiseProcess.NoiseProcess(N=0.022)

Implements the noise process of the two process model.

sample()

Sample random noise from Gaussian distribution with 0 mean and std of 1.

Returns:Noise sample.

More information about the model —

Indices and tables