feat(tests): enhance tests with GBM for noise generation and improve tolerance for MAMA validation

feat(trends): implement IDisposable in Bessel and Conv classes to manage event subscriptions
fix(trends): add validation for period and parameters in Kama and MGDI calculations
fix(trends): clamp logarithmic calculations in JMA to avoid -Infinity
This commit is contained in:
Miha Kralj
2025-12-25 20:18:14 -08:00
parent df598c810d
commit ac8b2dbb3f
20 changed files with 281 additions and 187 deletions
+3 -3
View File
@@ -384,9 +384,9 @@ public class EmaTests
double[] output = new double[5];
// Alpha must be > 0 and <= 1
Assert.Throws<ArgumentException>(() => Ema.Batch(source.AsSpan(), output.AsSpan(), 0.0));
Assert.Throws<ArgumentException>(() => Ema.Batch(source.AsSpan(), output.AsSpan(), -0.1));
Assert.Throws<ArgumentException>(() => Ema.Batch(source.AsSpan(), output.AsSpan(), 1.1));
Assert.Throws<ArgumentOutOfRangeException>(() => Ema.Batch(source.AsSpan(), output.AsSpan(), 0.0));
Assert.Throws<ArgumentOutOfRangeException>(() => Ema.Batch(source.AsSpan(), output.AsSpan(), -0.1));
Assert.Throws<ArgumentOutOfRangeException>(() => Ema.Batch(source.AsSpan(), output.AsSpan(), 1.1));
}
[Fact]