ActExtendCosinor {ActCR}R Documentation

Extended Cosinor Model for Circadian Rhythmicity

Description

Extended cosinor model based on sigmoidally transformed cosine curve using anti-logistic transformation

Usage

ActExtendCosinor(
  x,
  window = 1,
  lower = c(0, 0, -1, 0, -3),
  upper = c(Inf, Inf, 1, Inf, 27),
  export_ts = FALSE
)

Arguments

x

vector vector of dimension n*1440 which represents n days of 1440 minute activity data

window

The calculation needs the window size of the data. E.g window = 1 means each epoch is in one-minute window.

lower

A numeric vector of lower bounds on each of the five parameters (in the order of minimum, amplitude, alpha, beta, acrophase) for the NLS. If not given, the default lower bound for each parameter is set to -Inf.

upper

A numeric vector of upper bounds on each of the five parameters (in the order of minimum, amplitude, alpha, beta, acrophase) for the NLS. If not given, the default lower bound for each parameter is set to Inf

export_ts

A Boolean to indicate whether time series should be exported

Value

A list with elements

minimum

Minimum value of the of the function.

amp

amplitude, a measure of half the extend of predictable variation within a cycle. This represents the highest activity one can achieve.

alpha

It determines whether the peaks of the curve are wider than the troughs: when alpha is small, the troughs are narrow and the peaks are wide; when alpha is large, the troughs are wide and the peaks are narrow.

beta

It dertermines whether the transformed function rises and falls more steeply than the cosine curve: large values of beta produce curves that are nearly square waves.

acrotime

acrophase is the time of day of the peak in the unit of the time (hours)

F_pseudo

Measure the improvement of the fit obtained by the non-linear estimation of the transformed cosine model

UpMesor

Time of day of switch from low to high activity. Represents the timing of the rest- activity rhythm. Lower (earlier) values indicate increase in activity earlier in the day and suggest a more advanced circadian phase.

DownMesor

Time of day of switch from high to low activity. Represents the timing of the rest-activity rhythm. Lower (earlier) values indicate decline in activity earlier in the day, suggesting a more advanced circadian phase.

MESOR

A measure analogous to the MESOR of the cosine model (or half the deflection of the curve) can be obtained from mes=min+amp/2. However, it goes through the middle of the peak, and is therefore not equal to the MESOR of the cosine model, which is the mean of the data.

ndays

Number of days modeled.

cosinor_ts

Exported data frame with time, time over days, original time series, fitted time series using cosinor model from step 1, and fitted extended cosinor model from step 2

References

Marler MR, Gehrman P, Martin JL, Ancoli-Israel S. The sigmoidally transformed cosine curve: a mathematical model for circadian rhythms with symmetric non-sinusoidal shapes. Stat Med.

Examples

count1 = c(t(example_activity_data$count[c(1:2),-c(1,2)]))
cos_coeff = ActExtendCosinor(x = count1, window = 1,export_ts = TRUE)

[Package ActCR version 0.3.0 Index]