mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-08-23 21:18:04 +00:00
Refactor error handling and calculations in TheilU, Wmape, and TukeyBiweight classes; update buffer handling for consistency
- Updated buffer handling in TheilU and Wmape classes to ensure consistency after adding new values. - Changed the resync interval constant in TukeyBiweight for better clarity. - Refactored state structures to record structs in Gauss, Hann, Hp, Hpf, Kalman, Loess, Notch, and other filter classes for improved performance and readability. - Enhanced numerical stability in Mama class calculations using Fused Multiply-Add (FMA) for precision. - Added comprehensive tests for Atan2 validation to compare .NET's Math.Atan2 with PineScript's implementation, ensuring accuracy across various edge cases. - Updated NDepend badges to reflect changes in classes, methods, and lines of code.
This commit is contained in:
@@ -29,6 +29,7 @@ public sealed class TukeyBiweight : BiInputIndicatorBase
|
||||
{
|
||||
private readonly double _cSquaredOver6;
|
||||
private const double DefaultC = 4.685; // 95% efficiency for normal distribution
|
||||
private const int BatchResyncInterval = 1000; // Local constant for static Batch method
|
||||
|
||||
public TukeyBiweight(int period, double c = DefaultC)
|
||||
: base(period, $"TukeyBiweight({period},{c:F3})")
|
||||
@@ -104,7 +105,7 @@ public sealed class TukeyBiweight : BiInputIndicatorBase
|
||||
ErrorHelpers.ComputeTukeyBiweightErrors(actual, predicted, errors, c);
|
||||
|
||||
// Step 2: Apply rolling mean
|
||||
ErrorHelpers.ApplyRollingMean(errors, output, period, ResyncInterval);
|
||||
ErrorHelpers.ApplyRollingMean(errors, output, period, BatchResyncInterval);
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user