These disorders involve difficulty initiating or maintaining sleep, or misalignment between the endogenous circadian system and environmental or social demands. Chronic insomnia is primarily a clinical diagnosis, but PSG may be used to exclude comorbid sleep pathology. Circadian rhythm sleep-wake disorders, including delayed sleep phase and shift-work disorder, are evaluated using actigraphy, sleep diaries, and in some cases PSG, to confirm phase shifts or rule out overlapping sleep disorders.