2026-02-27 07:48:12 -08:00
# RMSE: Root Mean Squared Error
2026-03-11 20:21:52 -07:00
> *MSE's more interpretable sibling that speaks the language of your data.*
2026-02-27 07:48:12 -08:00
| Property | Value |
| ---------------- | -------------------------------- |
| **Category** | Error Metric |
fix(docs): correct .md documentation across errors, dynamics, filters, forecasts, momentum, numerics, oscillators, reversals, statistics, trends, volatility, volume
2026-03-10 18:38:23 -07:00
| **Inputs** | Actual, Predicted (dual series) |
2026-02-27 07:48:12 -08:00
| **Parameters** | `period` |
| **Outputs** | Single series (RMSE) |
| **Output range** | $\geq 0$ |
fix(docs): correct .md documentation across errors, dynamics, filters, forecasts, momentum, numerics, oscillators, reversals, statistics, trends, volatility, volume
2026-03-10 18:38:23 -07:00
| **Warmup** | `period` bars |
2026-03-11 15:35:33 -07:00
| **PineScript** | [rmse.pine ](rmse.pine ) |
2026-02-27 07:48:12 -08:00
- Root Mean Squared Error (RMSE) is the square root of MSE, providing an error metric in the same units as the original data while retaining sensitiv...
2026-03-13 13:46:52 -07:00
- **Similar:** [MSE ](../mse/Mse.md ), [MAE ](../mae/Mae.md ) | **Trading note:** Root Mean Squared Error; same units as input, emphasizes large deviations. Most common accuracy metric.
2026-02-27 07:48:12 -08:00
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
2026-01-18 19:02:03 -08:00
Root Mean Squared Error (RMSE) is the square root of MSE, providing an error metric in the same units as the original data while retaining sensitivity to large errors.
## Mathematical Foundation
### Formula
$$RMSE = \sqrt{\frac{1}{n} \sum_{i=1}^{n} (y_i - \hat{y}_i)^2} = \sqrt{MSE}$$
## Properties
* **Non-negative**: RMSE ≥ 0
* **Same units**: Unlike MSE, RMSE is in original data units
* **Outlier sensitive**: Inherits MSE's penalty for large errors
* **Always ≥ MAE**: RMSE ≥ MAE due to Jensen's inequality
## Usage
```csharp
var rmse = new Rmse ( period : 20 );
var result = rmse . Update ( actualValue , predictedValue );
// Batch calculation
var results = Rmse . Calculate ( actualSeries , predictedSeries , period : 20 );
```
## Performance Profile
2026-02-26 22:02:52 -08:00
### Operation Count (Streaming Mode)
O(1) per bar. Single-pass scalar transformation of (actual, forecast) pair; no lookback window required.
| Operation | Count | Cost (cycles) | Subtotal |
| :--- | :---: | :---: | :---: |
| Error computation (subtract, abs/square/log) | 1-3 | ~3-8 cy | ~5-15 cy |
| Running accumulator update (EMA or sum) | 1 | ~4 cy | ~4 cy |
| **Total** | **2-4** | — | ** ~9-19 cycles** |
Streaming update requires only the current actual/forecast pair and running state. ~10-15 cycles/bar typical.
### Batch Mode (SIMD Analysis)
| Operation | Vectorizable? | Notes |
| :--- | :---: | :--- |
| Element-wise error computation | Yes | Independent per bar; fully vectorizable with `Vector<double>` |
| Reduction (sum/mean) | Yes | Parallel reduction; AVX2 gives 4x speedup |
| Log/exp components | Partial | Transcendental ops; polynomial approx for SIMD |
Batch SIMD: 4x-8x speedup for large windows. ~3-5 cy/bar amortized in vectorized batch mode.
2026-01-18 19:02:03 -08:00
| Metric | Score | Notes |
| :--- | :--- | :--- |
| **Throughput** | ~15 ns/bar | O(1) with sqrt operation |
| **Allocations** | 0 | Pre-allocated ring buffer |
| **Complexity** | O(1) | Constant time per update |
## Related Indicators
* [MSE ](../mse/Mse.md ) - Mean Squared Error
2026-03-13 13:46:52 -07:00
* [MAE ](../mae/Mae.md ) - Mean Absolute Error