The density of REM sleep is calculated based on the frequency of eye movements during sleep. This density is not constant throughout the REM phase. As the time spent in REM sleep increases, the density also increases, indicating that the depth of sleep has increased.