This function uses stats::optim() to compute various properties of fitted curves with respect to time, potentially in each condition and for each posterior sample, and adjusting for any covariates.

getRhythmStats(
  fit,
  fitType = c("posterior_mean", "posterior_samples", "raw"),
  features = NULL,
  dopar = TRUE
)

Arguments

fit

A limorhyde2 object.

fitType

String indicating which fitted models to use to compute the rhythmic statistics. A typical analysis using limorhyde2 will be based on 'posterior_mean', the default.

features

Vector of names, row numbers, or logical values for subsetting the features. NULL indicates all features.

dopar

Logical indicating whether to run calculations in parallel if a parallel backend is already set up, e.g., using doParallel::registerDoParallel(). Recommended to minimize runtime.

Value

A data.table containing the following rhythmic statistics:

  • peak_phase: time between 0 and fit$period at which the peak or maximum value occurs

  • peak_value

  • trough_phase: time between 0 and fit$period at which the trough or minimum value occurs

  • trough_value

  • peak_trough_amp: peak_value - trough_value

  • rms_amp: root mean square difference between fitted curve and mean value between time 0 and fit$period

  • mean_value: between time 0 and fit$period

The rows of the data.table depend on the fit object and fitType:

  • fit contains data from one condition and fitType is posterior_mean' or 'raw': one row per feature.

  • fit contains data from one condition and fitType is 'posterior_samples': one row per feature per posterior sample.

  • fit contains data from multiple conditions and fitType is 'posterior_mean' or 'raw': one row per feature per condition.

  • fit contains data from multiple conditions and fitType is 'posterior_samples': one row per feature per condition per posterior sample.

See also