These functions compare the non-visual circadian response (see nvRC
)
for measured personal light exposure to the nvRC for a reference light exposure pattern,
such as daylight.
Usage
nvRC_circadianDisturbance(nvRC, nvRC.ref, as.df = FALSE)
nvRC_circadianBias(nvRC, nvRC.ref, as.df = FALSE)
nvRC_relativeAmplitudeError(nvRC, nvRC.ref, as.df = FALSE)
Arguments
- nvRC
Time series of non-visual circadian response (see
nvRC
.- nvRC.ref
Time series of non-visual circadian response circadian response (see
nvRC
for a reference light exposure pattern (e.g., daylight). Must be the same length asnvRC
.- as.df
Logical. Should the output be returned as a data frame? Defaults to TRUE.
Details
nvRC_circadianDisturbance()
calculates the circadian disturbance (CD).
It is expressed as
$$CD(i,T)=\frac{1}{T}\int_{t_{i}}^{t_{i}+T} {\lvert r_{C}(t)-r_{C}^{ref}(t)\rvert dt},$$
and quantifies the total difference between the measured circadian response and the circadian response to a reference profile.
nvRC_circadianBias()
calculates the circadian bias (CB).
It is expressed as
$$CB(i,T)=\frac{1}{T}\int_{t_{i}}^{t_{i}+T} {(r_{C}(t)-r_{C}^{ref}(t))dt},$$
and provides a measure of the overall trend for the difference in circadian response, i.e. positive values for overestimating and negative for underestimating between the measured circadian response and the circadian response to a reference profile.
nvRC_relativeAmplitudeError()
calculates the relative amplitude error (RAE).
It is expressed as
$$RAE(i,T)=r_{C,max}-r_{C,max}^{ref},$$
and quantifies the difference between the maximum response achieved in a period to the reference signal.
References
Amundadottir, M.L. (2016). Light-driven model for identifying indicators of non-visual health potential in the built environment [Doctoral dissertation, EPFL]. EPFL infoscience. doi:10.5075/epfl-thesis-7146
Examples
dataset1 <-
tibble::tibble(
Id = rep("B", 60 * 24),
Datetime = lubridate::as_datetime(0) + lubridate::minutes(0:(60*24-1)),
Illuminance = c(rep(0, 60*8), rep(sample(1:1000, 16, replace = TRUE), each = 60)),
MEDI = Illuminance * rep(sample(0.5:1.5, 24, replace = TRUE), each = 60),
) %>%
dplyr::mutate(
nvRC = nvRC(MEDI, Illuminance, Datetime, sleep.onset = hms::as_hms("22:00:00"))
)
dataset.reference <-
tibble::tibble(
Id = rep("Daylight", 60 * 24),
Datetime = lubridate::as_datetime(0) + lubridate::minutes(0:(60*24-1)),
Illuminance = c(rep(0, 60*6), rep(10000, 12*60), rep(0, 60*6)),
MEDI = Illuminance
) %>%
dplyr::mutate(
nvRC = nvRC(MEDI, Illuminance, Datetime, sleep.onset = hms::as_hms("22:00:00"))
)
# Circadian disturbance
nvRC_circadianDisturbance(dataset1$nvRC, dataset.reference$nvRC)
#> [1] 0.2605862
# Circadian bias
nvRC_circadianBias(dataset1$nvRC, dataset.reference$nvRC)
#> [1] -0.04904808
# Relative amplitude error
nvRC_relativeAmplitudeError(dataset1$nvRC, dataset.reference$nvRC)
#> [1] 0.3263525