> For the complete documentation index, see [llms.txt](https://time-series-features.gitbook.io/catch22/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/information-about-catch22/feature-descriptions/simple-forecasting.md).

# Simple forecasting

Feature of a 3-point mean forecast.

## `forecast_error`

### What it does

[`forecast_error`](#user-content-fn-1)[^1] returns the a measure of error from using the mean of the previous 3 values of the time series to predict the next value. The error statistic used here is the standard deviation of the residuals from the full set of simple 1-step forecasts. Because the input time series is *z*-scored (standard deviation of 1), the residuals should have a standard deviation less than 1 if this forecasting method is doing something (at least minimally) useful.

In *hctsa*, this feature is the `stde` output of `FC_LocalSimple(x_z,'mean',3)`. A constant time series, which cannot be *z*-scored, is treated as perfectly predictable: by default (with masking), it returns 0 (earlier versions returned `NaN`).

{% hint style="info" %}
**Changes in v1.0**: The values are unchanged, but the long name changed from `FC_LocalSimple_mean3_stderr` to `FC_LocalSimple_mean3_stde`, following *hctsa*.
{% endhint %}

{% tabs %}
{% tab title="Example 1: Predator-Prey System" %}
Here's an example of a predator-prey system (black) for which the dynamics are varying on a timescale of 3 steps, such that mean-3 predictions (blue) are very poor forecasts. For this time series, the residuals have a higher variance than the original time series:

<figure><img src="https://650896658-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3Or28XkZfNq0bJ4X4zXE%2Fuploads%2FntZsOyGiFx0vySKemvqm%2Fimage.png?alt=media&amp;token=2a2eeb6c-9b61-497f-bf24-8c4327462835" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="Example 2: ODE" %}
This ODE system, by contrast is very highly sampled, such that the time series is a similar value in 3 steps, and the forecasts (blue) are very close to the original time series, yielding residuals with a very low standard deviation (0.03):

<figure><img src="https://650896658-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3Or28XkZfNq0bJ4X4zXE%2Fuploads%2FpQtMFB1KfdCgUsMlOg9c%2Fimage.png?alt=media&amp;token=0381ef1c-463b-4c82-ad9c-f3e8653f1de2" alt=""><figcaption></figcaption></figure>
{% endtab %}
{% endtabs %}

***

[^1]: **Naming info**: Short name `forecast_error`; long name `FC_LocalSimple_mean3_stde` (before v1.0: `FC_LocalSimple_mean3_stderr`), matching the *hctsa* feature of the same name. It computes the `stde` output from running the code `FC_LocalSimple(x_z,'mean',3)` in *hctsa*.


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://time-series-features.gitbook.io/catch22/information-about-catch22/feature-descriptions/simple-forecasting.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
