summaryrefslogtreecommitdiffstats
path: root/test/kalman_filter.c
diff options
context:
space:
mode:
authorEthan Werner <mail@ethanwerner.com>2026-07-01 09:42:39 +0400
committerEthan Werner <mail@ethanwerner.com>2026-07-01 09:42:39 +0400
commit07e18043145f3d91c8ea7ec3ad41b3c905585277 (patch)
tree2bdeae46973f4bdfce263679a4008ac768011f28 /test/kalman_filter.c
initial commit: ts time series analysis library v0.1.0
- 354 financial and mathematical time-series indicators - Uniform C11 API with consistent function signatures - 349 passing tests with -Werror - Static and shared library builds - pkg-config integration - Python bindings - Fuzzing and sanitizer support - Security hardening flags
Diffstat (limited to 'test/kalman_filter.c')
-rw-r--r--test/kalman_filter.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/kalman_filter.c b/test/kalman_filter.c
new file mode 100644
index 0000000..188ae82
--- /dev/null
+++ b/test/kalman_filter.c
@@ -0,0 +1,26 @@
+#include "ts.h"
+
+bool ts_test_kalman_filter( void )
+{
+ fp_t const x0[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
+
+ fp_t const e0[] = {
+ 1.0,
+ 1.5024875621890548,
+ 2.0099009900990099,
+ 2.5245821283270429,
+ 3.0487331327055625,
+ 3.5843788460830162,
+ 4.1333360364582399,
+ 4.6971903124447723,
+ 5.2772810678708257,
+ 5.8746943630334316
+ };
+
+ fp_t const * const x[] = { x0 };
+ fp_t const * const e[] = { e0 };
+
+ struct { fp_t Q; fp_t R; } c = { 0.01, 1.0 };
+
+ return ts_test(ts_kalman_filter, ts_kalman_filter_offset, x, e, 10, (ts_constant_t *)&c, &ts_kalman_filter_p);
+}