# Distribution shape

*catch22* contains two features involving the `DN_HistogramMode` function in *hctsa:*

* `mode_5` (the *hctsa* feature `DN_HistogramMode_5`)
* `mode_10` (the *hctsa* feature `DN_HistogramMode_10`)

{% hint style="info" %}
**Note**: The C implementation of these features (in *catch22)* does not map perfectly onto the *hctsa* implementation, due to slight differences in how the histogram bins are constructed. But the trends are similar.&#x20;
{% endhint %}

## What it does

These functions involve computing the mode of the z-scored time-series through the following steps:

1. z-score the input time series.
2. Compute a histogram using a given number of (linearly spaced) bins, e.g., 5 bins for `mode_5` and 10 bins for `mode_10.`&#x20;
3. Return the location of the bin with the most counts.

## What these features measure

Being distributional properties, these features are completely insensitive to the time-ordering of values in the time series. Instead, they capture how the most probable time-series values are positioned relative to the mean.

{% tabs %}
{% tab title="Example 1: Gaussian-distributed noise " %}
Time series with a **symmetric** distribution, with a central peak, will have a mode near the center, and value close to zero. Here is an example of [Gaussian-distributed noise](https://www.comp-engine.org/#!visualize/5dc3827a-3873-11e8-8680-0242ac120002):&#x20;

<figure><img src="https://650896658-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3Or28XkZfNq0bJ4X4zXE%2Fuploads%2FmB6xgj5eWZJa7EoigJag%2Fimage.png?alt=media&#x26;token=a2456dd4-a750-4841-ba02-f0b9eb7333be" alt=""><figcaption></figcaption></figure>

### <mark style="color:red;">Feature output:</mark> <mark style="color:red;"></mark><mark style="color:red;">`-0.36`</mark>

{% endtab %}

{% tab title="Example 2: Chirikov Map" %}
Time series with a **symmetric** distribution but with density far from the origin, like this [Chirikov map ](https://www.comp-engine.org/#!visualize/41411951-3871-11e8-8680-0242ac120002)obtain high (positive or negative) values:

<figure><img src="https://650896658-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3Or28XkZfNq0bJ4X4zXE%2Fuploads%2FybVSd2iAHQGrxnxusdrd%2Fimage.png?alt=media&#x26;token=5af055f4-9d77-4f7f-92aa-51a896e77764" alt=""><figcaption></figcaption></figure>

### <mark style="color:red;">Feature output:</mark> <mark style="color:red;"></mark><mark style="color:red;">`1.26`</mark>

{% endtab %}

{% tab title="Example 3: Beta-distributed noise" %}
Time series with **positively** skewed distributions, like this example of [beta-distributed noise ](https://www.comp-engine.org/#!visualize/20320f55-3872-11e8-8680-0242ac120002)obtain negative values as shown below:&#x20;

<figure><img src="https://650896658-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3Or28XkZfNq0bJ4X4zXE%2Fuploads%2FpAK7NIDqxBu8nnZB4hBE%2Fimage.png?alt=media&#x26;token=558493fc-26d7-4d72-8d5b-ebb1d2eda70a" alt=""><figcaption></figcaption></figure>

### <mark style="color:red;">Feature output:</mark> <mark style="color:red;"></mark><mark style="color:red;">`-0.805`</mark>

*Similarly, a **negatively** skewed distribution will yield positive values.*&#x20;
{% endtab %}
{% endtabs %}
