> ## Documentation Index
> Fetch the complete documentation index at: https://docs.spikeapi.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Statistic Types and Methods

> This document provides a comprehensive overview of all statistics, detailing their methods, metrics, units, precision, and descriptions. The table below summarizes the key features supported by each statistic.

## Statistics

The following table lists all the statistics available, along with their descriptions, applicable methods, associated metrics, units of measurement, and number of decimals for output precision.

| **Label** | **Description** | **Methods** | **Metrics** | **Unit** | **Precision** |
| :- | :- | :- | :- | :- | :- |
| calories\_burned\_active | Calories burned during active periods | intersect\_sum | `calories_burned_active` | kcal | 4 |
| calories\_burned\_basal | Calories burned at rest (basal metabolic rate) | intersect\_sum | `calories_burned_basal` | kcal | 4 |
| calories\_burned\_total | Total calories burned including basal and active periods | intersect\_union\_sum | `calories_burned` `calories_burned_basal` `calories_burned_active` | kcal | 4 |
| distance\_cycling | Total distance covered while cycling | intersect\_sum | `distance_cycling` | meters | 4 |
| distance\_running | Total distance covered while running | intersect\_sum | `distance_running` | meters | 4 |
| distance\_total | Total distance covered across all activities | intersect\_union\_sum | `distance` `distance_walking` `distance_cycling` `distance_running` | meters | 4 |
| distance\_walking | Total distance covered while walking | intersect\_sum | `distance_walking` | meters | 4 |
| duration\_high\_intensity | Duration of high level intensity | intersect\_sum | `duration_high_intensity` | ms | 0 |
| duration\_low\_intensity | Duration of low level intensity | intersect\_sum | `duration_low_intensity` | ms | 0 |
| duration\_moderate\_intensity | Duration of medium level intensity | intersect\_sum | `duration_moderate_intensity` | ms | 0 |
| heartrate | Average heart rate over a period | duration\_weighted\_avg | `heartrate` | bpm | 0 |
| heartrate\_max | Maximum recorded heart rate, providing insights into peak values | max | `heartrate` | bpm | 0 |
| heartrate\_min | Minimum recorded heart rate, providing insights into lowest values | min | `heartrate` | bpm | 0 |
| heartrate\_resting | Average resting heart rate | duration\_weighted\_avg | `heartrate_resting` | bpm | 0 |
| hrv\_rmssd | Heart rate variability measured by RMSSD | duration\_weighted\_avg | `hrv_rmssd` | ms | 0 |
| hrv\_sdnn | Heart rate variability measured by SDNN | duration\_weighted\_avg | `hrv_sdnn` | ms | 0 |
| sleep\_duration\_total | Total sleep duration across all sleep stages | intersect\_union\_sum | `sleep_duration_deep` `sleep_duration_light` `sleep_duration_rem` `sleep_duration_awake` | ms | 0 |
| sleep\_score | Overall sleep score based on various sleep metrics | sleep\_score | `bedtime_duration` `sleep_duration` `sleep_duration_nap` `sleep_duration_light` `sleep_duration_deep` `sleep_duration_rem` `sleep_duration_awake` `sleep_interruptions` `sleep_efficiency` `sleep_latency` `sleep_breathing_rate` | count | 0 |
| sleep\_skin\_temperature\_deviation | Sleep skin temperature deviation from the baseline | intersect\_sum | `sleep_skin_temperature_deviation` | celsius | 2 |
| steps | Total number of steps taken | intersect\_sum | `steps` | count | 0 |

## Methods

The table below provides details on the various methods used in the statistics, including a brief description of each.

| **Label** | **Description** |
| :- | :- |
| duration\_weighted\_avg | Average of values weighted by their duration, ensuring longer durations have a greater impact on the average. |
| intersect\_sum | Sum of intersecting values of specified metrics, aggregating overlapping data points to provide a total count or sum. |
| intersect\_union\_sum | Sum of the union of intersecting values, merging several metrics to provide a comprehensive aggregation across multiple metrics. |
| max | Maximum value of the specified metrics, providing insights into the peak values recorded. |
| min | Minimum value of the specified metrics, providing insights into the lowest values recorded. |
| sleep\_score | A score representing the quality of sleep, calculated using intersecting values. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.