Compute credible intervals for rhythm or differential rhythm statistics
Source:R/get_stats.R
getStatsIntervals.Rd
This function uses posterior samples to quantify uncertainty in the properties of fitted curves.
Usage
getStatsIntervals(posteriorStats, mass = 0.9, method = c("eti", "hdi"))
Arguments
- posteriorStats
A
data.table
of statistics for posterior samples, as returned bygetRhythmStats()
orgetDiffRhythmStats()
.- mass
Number between 0 and 1 indicating the probability mass for which to calculate the intervals.
- method
String indicating the type of interval: 'eti' for equal-tailed using
stats::quantile()
, or 'hdi' for highest density usingHDInterval::hdi()
.
Value
A data.table
containing lower and upper bounds of various
statistics for each feature or each feature-condition pair. For
peak_trough_amp
and rms_amp
, a negative lower bound indicates a rhythm
of the opposite phase.
Examples
library('data.table')
y = GSE54650$y
metadata = GSE54650$metadata
fit = getModelFit(y, metadata)
fit = getPosteriorFit(fit)
fit = getPosteriorSamples(fit, nPosteriorSamples = 10L)
rhyStatsSamps = getRhythmStats(
fit, features = c('13170', '13869'), fitType = 'posterior_samples')
rhyStatsInts = getStatsIntervals(rhyStatsSamps)