> For the complete documentation index, see [llms.txt](https://time-series-features.gitbook.io/catch22-features/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://time-series-features.gitbook.io/catch22-features/catch22/self-affine-scaling.md).

# Self-affine scaling

*catch22* contains two features that capture the behavior of two features based on fluctuation analysis, which aim to capture potential long-range correlations in time series, derived from the `SC_FluctAnal` function in [*hctsa*](https://github.com/benfulcher/hctsa).

Here is a reference for understanding scaling methods: *Power spectrum and detrended fluctuation analysis: Application to daily temperatures* Talkner and Weber, *Phys. Rev. E* **62:** 150 (2000).

The main steps of the method are as follows:

1. Compute a cumulative sum of the time series
2. Compute the level of fluctuation (e.g., root-mean-square deviations from local low-order trends) across windows corresponding to a given timescale. Different methods exist for detrending time-series windows at a given timescale, including (relevant to these two features):
   1. Rescaled range analysis removes a line connecting the endpoints of each window and computes the range of the remaining points (Caccia et al., Physica A, 1997)
   2. DFA fits a *k*-order polynomial to each window and computes the residuals from this fit.
3. Looks for linear scaling in the log(timescale)–log(fluctuation) plot.

Some time series exhibit 'multifractal' scaling: there are different scaling rules at different ranges of timescales. The two *catch22* features fit two distinct scaling regimes and return the timescale at which the predicted change in scaling regime occurs.

Note that these features make quite strong assumptions about the data and can be unstable for time series that do not exhibit scaling, or exhibit strong but 'unifractal' scaling.

## `rs_range`

**Naming info**: This feature matches the feature in *hctsa* named `SC_FluctAnal_2_rsrangefit_50_1_logi_prop_r1`.

`rs_range` uses rescaled range analysis described above to estimate points in logarithmic timescale–fluctuation space.

Time series with (the best approximation to two distinct scaling regimes: the first scaling regime is indicated with red markers in the plots below) that change at a short timescale, like this AR(2) process, receive low values of this feature (`rs_range = 0.2`):

![](/files/qvYUc8iVlcwB0z8ts7zy)

And gives high values for time series where the scaling regime changes at longer timescales:

![](/files/7IBdNEDAOpRF141bUo5F)

Or this complex butterfly map:

![](/files/9Jv1GUL8T5xLQUGneLsr)

## `dfa`

**Naming info**: This feature matches the *hctsa* feature called `SC_FluctAnal_2_dfa_50_1_2_logi_prop_r1`

`dfa` measures the same property as above, but from a timescale–fluctuation curve estimated using detrended fluctuation analysis (DFA), using linear detrending in each window, after down-sampling the time series by a factor of 2.

It displays qualitatively similar behavior as the above, e.g., with low value for this oscillator (which has a change in the scaling relationship at short timescales).

![](/files/RdEZuT2cvxMNC6Pc2oAi)

And higher values for time series that exhibit strong scaling through to longer timescales, like this log-return series of an opening share price:

![](/files/L06h9G5CyK1cn9reEYuP)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://time-series-features.gitbook.io/catch22-features/catch22/self-affine-scaling.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
