doc headers

This commit is contained in:
Miha Kralj
2026-02-27 07:48:12 -08:00
parent 8a1ba95173
commit 4ab3a7fb53
389 changed files with 6682 additions and 468 deletions
+5 -5
View File
@@ -114,11 +114,11 @@ public class AcfValidationTests
// For white noise, ACF at any lag > 0 should be close to zero
var acf = new Acf(100, 5);
// Generate pseudo-random values with zero mean
var random = new Random(42);
// Generate pseudo-random values with zero mean via GBM log-returns
var random = new GBM(startPrice: 100.0, sigma: 1.0, seed: 42);
for (int i = 0; i < 500; i++)
{
double val = random.NextDouble() * 2 - 1; // Uniform [-1, 1]
double val = Math.Log(random.Next().Close / 100.0); // ~N(0, vol²*dt) centered near 0
acf.Update(new TValue(DateTime.UtcNow.AddSeconds(i), val));
}
@@ -215,12 +215,12 @@ public class AcfValidationTests
double[] ar1Data = new double[n];
ar1Data[0] = 0;
var random = new Random(42);
var random = new GBM(startPrice: 100.0, sigma: 1.0, seed: 42);
// Generate AR(1) process
for (int i = 1; i < n; i++)
{
double epsilon = (random.NextDouble() * 2 - 1) * 0.1; // Small noise
double epsilon = Math.Log(random.Next().Close / 100.0) * 0.1; // Small noise
ar1Data[i] = phi * ar1Data[i - 1] + epsilon;
}
+18 -1
View File
@@ -1,5 +1,22 @@
# ACF: Autocorrelation Function
| Property | Value |
| ---------------- | -------------------------------- |
| **Category** | Statistic |
| **Inputs** | Source (close) |
| **Parameters** | `period`, `lag` (default 1) |
| **Outputs** | Single series (Acf) |
| **Output range** | Varies (see docs) |
| **Warmup** | `period` bars |
### TL;DR
- The Autocorrelation Function (ACF) measures the correlation of a time series with a lagged copy of itself.
- Parameterized by `period`, `lag` (default 1).
- Output range: Varies (see docs).
- Requires `period` bars of warmup before first valid output (IsHot = true).
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
> "The past doesn't predict the future, but it whispers patterns to those who listen."
The Autocorrelation Function (ACF) measures the correlation of a time series with a lagged copy of itself. It is fundamental for identifying repeating patterns, seasonal effects, and determining the order of time series models like ARMA/ARIMA.
@@ -159,4 +176,4 @@ A random walk should have ACF ≈ 0 at all lags. Significant ACF values indicate
- Box, G.E.P., Jenkins, G.M. (1970). *Time Series Analysis: Forecasting and Control*. Holden-Day.
- Hamilton, J.D. (1994). *Time Series Analysis*. Princeton University Press.
- Yule, G.U. (1927). "On a Method of Investigating Periodicities in Disturbed Series." *Philosophical Transactions of the Royal Society*.
- Yule, G.U. (1927). "On a Method of Investigating Periodicities in Disturbed Series." *Philosophical Transactions of the Royal Society*.