To determine the sleep window, average values of bed times and sleep duration are needed. However, some patients may be unable to reliably report their sleep-wake behavior — for example, due to acute crises, substance use, or severe illness-related symptoms that cause a disrupted and irregular sleep rhythm. If patients have only recently been admitted or are unable to provide accurate information, an initial sleep window is estimated, and a sleep diary is kept in parallel. Based on the diary data and ongoing communication with the patient, the sleep window is then adjusted and optimized.