# Trend Analysis

## Overview

**Trend Analysis** shows whether a raw metric, viewable in [single-destination views](https://docs.thousandeyes.com/product-documentation/internet-insights/provider-intelligence/view-results/destination-views), is **increasing, decreasing, or staying flat** over your selected time frame. This is critical for identifying:

* **Degradation**: Is latency creeping up over months?
* **Improvement**: Is a provider's stability improving after infrastructure upgrades?
* **Stability**: Is performance holding steady (ideal for long-term contracts)?

Provider Intelligence uses an algorithm that ensures that the trend reflects a statistically significant movement over time rather than just temporary fluctuations.

## Trend Calculation

1. **Create a Time Index:** Assign a sequential index to each hour in the time series:

   | Hour | Time Index |
   | ---- | ---------- |
   | 1    | 1          |
   | 2    | 2          |
   | 3    | 3          |
   | ...  | ...        |
   | 720  | 720        |
2. **Measure the relationship (correlation)**: The algorithm analyzes the relationship between the performance metric values and the linear time index. It looks for how consistently the two variables move together:

   * **Positive correlation**: If the metric values tend to increase as the time index increases, it suggests an upward trajectory.
   * **Negative correlation**: If the metric values tend to decrease as the time index increases, it suggests a downward trajectory.
   * **No correlation**: If the metric values fluctuate randomly or stay the same regardless of time, there is no strong correlation.

   The algorithm applies a single value to the correlation (a coefficient) in a range from −1 (perfect negative correlation) to +1 (perfect positive correlation).
3. **Map to trend lines**: The system applies specific thresholds to this coefficient to provide a user-friendly line on the results page:

   | Coefficient Range | Trend Line (most metrics)         | Trend line (throughput)\*         |
   | ----------------- | --------------------------------- | --------------------------------- |
   | -1.00 to -0.50    | Down, green (improving)           | Up, red (improving)               |
   | -0.50 to +0.50    | Flat, gray (no significant trend) | Flat, gray (no significant trend) |
   | +0.50 to +1.00    | Up, red (worsening)               | Down, green (worsening)           |

   \* Most metrics perform better at lower values. Throughput alone performs better at higher values.

### Example: Latency Increasing

| Hour | Latency (ms) |
| ---- | ------------ |
| 1    | 10           |
| 2    | 12           |
| 3    | 15           |
| 4    | 18           |
| 5    | 20           |

**Coefficient**: +0.95

**Trend**: the raw metric trend line points up (worsening: lower values are better).

## Trend Variability

Trends are calculated separately for each [percentile](https://docs.thousandeyes.com/product-documentation/internet-insights/provider-intelligence/view-results/summary-statistics#understanding-percentiles) (P5, P50, etc.) and for each time frame (1, 3, 6 months). This means:

* You might see the latency trend point down (improving) at P95 but flat at P50, indicating that worst-case performance is improving while typical performance remains steady.
* The latency trend might point up (worsening) over 6 months but flat over 1 month, indicating latency worsened in earlier months, but has been steady over the last month.


---

# Agent Instructions: 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:

```
GET https://docs.thousandeyes.com/product-documentation/internet-insights/provider-intelligence/scoring-methodologies/trend-analysis.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
