Measure food anticipation¶
Question¶
Did activity rise before the declared mealtime?
See every package-generated example · Read the complete analysis pipeline
When to use¶
Use this with a dated restricted-feeding schedule to quantify activity before mealtime and its acquisition across days.
Example figure¶
This deterministic example is calculated by the food_anticipation action and drawn by render_food_anticipation_svg, the same renderer used for publication export. Empty or withheld elements are therefore visible exactly as they are in a real result.
import circadian_workbench as cw
cw.call("food_anticipation", recording={"path": "restricted_feeding.awd"})
Required inputs and controls¶
The public function is the registered action below. settings= is accepted as a friendlier alias for config= by cw.call; the calculation stores the complete normalized config in provenance.
Function reference¶
cw.call("food_anticipation", recording, config=None)
Arguments and parameters¶
| Name | Type | Required | Default | Units | Meaning |
|---|---|---|---|---|---|
recording |
recording spec | yes | — | - | The record to analyse: {'path': 'data/m01.awd'} (a bare path string also works), {'demo': true} for the built-in deterministic record, {'inline': {'filename': ..., 'text': ...}} for tabular text, {'trace': {'hours': [...], 'values': [...], 'name': ...}} for one elapsed-time trace, or {'channels': {'hours': [...], 'values': {'reporter_a': [...], 'reporter_b': [...]}}} for several measurements from one subject. |
config |
object | no | null |
- | Partial analysis config. Missing keys fall back to analysis.DEFAULT_CONFIG and out-of-range values are clamped silently — run describe_config for every key, its default and its allowed values, or normalize_config to see what a given config actually becomes. |
Every nested config key, default, allowed value, and purpose is listed in the complete configuration reference.
How it works¶
Pre-meal activity is compared with daily and post-meal activity. Acquisition is called only after the anticipatory ratio exceeds a baseline-derived criterion for a held run.
$$ \text{anticipation index}=\frac{A_{\mathrm{pre}}}{A_{\mathrm{pre}}+A_{\mathrm{post}}} $$
Implementation: feeding.py::food_anticipation.
Outputs and interpretation¶
Daily rows report pre-meal activity, ratios, anticipation index, criterion crossing, acquisition day, fasting-day handling, coverage, and inferential summary.
cw.call returns a Result: use .data for calculated values, .warnings for scientific qualifications, .provenance for version and input identity, .script for an equivalent replay script, and .files for saved outputs.
Limitations¶
A declared feeding schedule and enough covered feeding days are required. Increased total daily activity alone does not establish food anticipation.
Example¶
The figure above is a real package result from a seeded, redistributable synthetic dataset. Its audited project bundle retains figure_data.csv, a standalone plot.py, source hashes, an editable SVG, and a rendered preview.
Methods text¶
Food-anticipatory activity was quantified in the declared pre-meal window relative to daily and post-meal activity; acquisition required the baseline-derived criterion to hold for the configured number of days.
See also¶
Score immobility sleep · Find ultradian rhythms · Test temperature compensation · Analysis index · Gallery