---
title: "Sample Entropy: Formula, Meaning"
description: "Sample entropy, introduced by Richman and Moorman, estimates the irregularity of a time series. It is the negative natural log of the conditional..."
canonical: https://www.getswoopr.com/indicators/statistical-and-quantitative/sample-entropy/
source: "Swoopr Investment: https://www.getswoopr.com"
---

## Direct Answer



> Sample entropy, introduced by Richman and Moorman, estimates the irregularity of a time series. It is the negative natural log of the conditional probability that sequences that match for m points still match at the next point, within a tolerance r. Low values mean the series is regular and self-similar, so sequences tend to repeat.





      


# Sample Entropy: Formula, Meaning, Signals, Examples and How to Use It



## How Is Sample Entropy Calculated?

Sample entropy, introduced by Richman and Moorman, estimates the irregularity of a time series. It is the negative natural log of the conditional probability that sequences that match for m points still match at the next point, within a tolerance r.

**Formula:** `SampEn(m, r) = -ln(A / B), where B counts pairs of length-m templates within tolerance r (maximum distance), A counts the same for length m+1, and self-matches are excluded`

**Inputs:**

- Series values
- Embedding length m (commonly 2)
- Tolerance r (commonly 0.2 times the standard deviation)
- Window length N

**Worked example.** With 30 matching pairs at length m+1 out of 60 at length m, sample entropy is 0.693. The inputs are illustrative numbers, not market data.

**Reading it.** Low values mean the series is regular and self-similar, so sequences tend to repeat. High values mean it is irregular and less predictable. The result is only comparable across series using the same m, r and length.

**Limits.** It needs a few hundred points to be stable and is undefined when no matches exist at length m+1. Results are sensitive to the tolerance setting.


      

## What is Sample Entropy?



Sample entropy, introduced by Richman and Moorman, estimates the irregularity of a time series. It is the negative natural log of the conditional probability that sequences that match for m points still match at the next point, within a tolerance r.




## How to use Sample Entropy



Low values mean the series is regular and self-similar, so sequences tend to repeat. High values mean it is irregular and less predictable. The result is only comparable across series using the same m, r and length. A reading alone is never a buy or sell signal; it needs context from price structure, volume, volatility and the broader market regime.




## Strengths



- Excluding self-matches removes the built-in bias that approximate entropy carries, so the estimate depends only on genuine repeats.
- Template matching uses the maximum distance within tolerance r, so the same test is applied equally to every point in the sequences.
- Reproducible when the formula and data convention are fixed.




## Weaknesses and limitations



- Embedding length m and tolerance r interact, so changing one can alter the ordering of two series' entropy values.
- Because it counts only repeating templates, a series with a steady drift is matched poorly unless it is detrended or differenced first.
- Correlated indicators can create false confidence by repeating the same underlying information.




## Editorial and risk note



This page is educational content, not individualized investment advice. It should not imply guaranteed prediction, accuracy or outperformance.







## Frequently Asked Questions


        



Is Sample Entropy a buy or sell signal?




No. Low values mean the series is regular and self-similar, so sequences tend to repeat. It needs a few hundred points to be stable and is undefined when no matches exist at length m+1. A trade built on it still needs a trigger, an invalidation rule, a position size and realistic execution assumptions.










What is the best setting for Sample Entropy?




Sample Entropy takes these inputs: series values; embedding length m (commonly 2); tolerance r (commonly 0.2 times the standard deviation). There is no universal best setting for the tunable ones, so test them across instruments, regimes and out-of-sample periods and favor stable parameter regions over one historical winner.










Can Sample Entropy be used by itself?




It needs a few hundred points to be stable and is undefined when no matches exist at length m+1. Results are sensitive to the tolerance setting. For that reason it is read next to measures of direction, participation, valuation, liquidity and risk, not alone.










Does Sample Entropy work on every timeframe?




The calculation (SampEn(m, r) = -ln(A / B), where B counts pairs of length-m templates within tolerance r (maximum distance), A counts the same for length m+1, and self-matches are excluded) can be run on any bar size, but behavior is not portable: a reading on a five-minute chart describes a very different market window from the same reading on a daily chart. Validate the exact timeframe before relying on it.










Why does Sample Entropy give false signals?




Embedding length m and tolerance r interact, so changing one can alter the ordering of two series' entropy values. Because it counts only repeating templates, a series with a steady drift is matched poorly unless it is detrended or differenced first. Lag, noise and regime changes add to this, because market participants react to new information after the reading is calculated.










How should Sample Entropy be backtested?




Rebuild Sample Entropy from series values using point-in-time data, write the rules before testing, include delisted securities where relevant, model realistic fills and costs, reserve a validation sample and compare with a simpler baseline.










## References

- [American Journal of Physiology-Heart and Circulatory Physiology: Physiological time-series analysis using approximate entropy and sample entropy (2000)](https://doi.org/10.1152/ajpheart.2000.278.6.H2039)



S




Swoopr Editorial Team



The Swoopr Editorial Team produces independent investment education, research, and tools for understanding markets, evaluating opportunities, and managing risk. All content is educational only and does not constitute personalized investment advice.



See our [editorial policy](https://www.getswoopr.com/legal/editorial-policy/) and [corrections policy](https://www.getswoopr.com/legal/corrections-policy/).
