mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-08-23 13:08:04 +00:00
Add R² and SMAPE error metrics with comprehensive tests and documentation
- Introduced R² (Coefficient of Determination) metric with detailed mathematical foundation, performance profile, and usage examples. - Implemented SMAPE (Symmetric Mean Absolute Percentage Error) metric, addressing asymmetry in MAPE with symmetric error calculations. - Added unit tests for SMAPE covering various scenarios including edge cases and input validation. - Enhanced Dema class to correctly handle event publishing with isNew parameter. - Updated Quantower test project to include coverage configuration for better test reporting.
This commit is contained in:
@@ -97,7 +97,7 @@ public sealed class Dema : AbstractBase, IDisposable
|
||||
if (double.IsNaN(val))
|
||||
{
|
||||
Last = new TValue(input.Time, double.NaN);
|
||||
PubEvent(Last);
|
||||
PubEvent(Last, isNew);
|
||||
return Last;
|
||||
}
|
||||
|
||||
@@ -108,7 +108,7 @@ public sealed class Dema : AbstractBase, IDisposable
|
||||
|
||||
double result = 2 * e1 - e2;
|
||||
Last = new TValue(input.Time, result);
|
||||
PubEvent(Last);
|
||||
PubEvent(Last, isNew);
|
||||
return Last;
|
||||
}
|
||||
|
||||
@@ -337,4 +337,4 @@ public sealed class Dema : AbstractBase, IDisposable
|
||||
}
|
||||
|
||||
private void Handle(object? sender, in TValueEventArgs e) => Update(e.Value, e.IsNew);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user