@markrutten I have been working in Python, so to double-check your assertion before I replied I moved over to the Java side to see what results I got there. On the Java side you seem to be correct; I wasn’t actually able to do the multiplication so I can’t be completely sure, but the results I got definitely support your statement. However, on the Python side this does not seem to be correct. Linking my code to prove it is unfortunately not possible because it’s all work-related, but here are some numeric results for the STM from one of my test cases.
First case: all data points accepted
Date: <AbsoluteDate: 2024-09-21T00:21:42.000Z>
STM: <RealMatrix: Array2DRowRealMatrix{
{1.0004559976,-0.0003226336,0.0007706352,30.0044704922,-0.0032102944,0.0077318896,0.0001148092,0.0},
{-0.0003226352,0.9995337127,-0.0002428801,-0.0032102504,29.9953357153,-0.0024459733,0.0000049138,0.0},
{0.0007706459,-0.0002428822,1.0000106129,0.0077319397,-0.0024459164,30.0001955994,-0.0001509391,0.0},
{0.0000298165,-0.0000214037,0.0000515481,1.000438194,-0.00031942,0.000775674,0.0000077098,0.0},
{-0.0000214038,-0.0000310893,-0.0000163079,-0.0003194178,0.9995334785,-0.0002463113,0.0000003077,0.0},
{0.0000515495,-0.0000163081,0.0000013159,0.000775683,-0.0002463087,1.0000286418,-0.0000100235,0.0},
{0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0},
{0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0}}>
Date: <AbsoluteDate: 2024-09-21T00:22:12.000Z>
STM: <RealMatrix: Array2DRowRealMatrix{
{1.0004023049,-0.0003127656,0.0007845248,30.0039321985,-0.0031105494,0.007864653,0.0001188597,0.0},
{-0.0003127671,0.9995329456,-0.0002529564,-0.0031105028,29.9953276894,-0.0025456371,0.0000030995,0.0},
{0.0007845354,-0.0002529586,1.0000650725,0.0078647025,-0.0025455814,30.0007419193,-0.000146208,0.0},
{0.0000262277,-0.0000207386,0.0000524332,1.000384233,-0.0003093391,0.0007883343,0.0000079631,0.0},
{-0.0000207388,-0.0000311428,-0.0000169723,-0.0003093368,0.9995326405,-0.0002561667,0.0000001865,0.0},
{0.0000524346,-0.0000169726,0.0000049582,0.0007883432,-0.0002561642,1.0000834408,-0.0000096883,0.0},
{0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0},
{0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0}}>
Second case: Point 21:42
rejected by filter, KF moves on to point 22:12
Date: <AbsoluteDate: 2024-09-21T00:22:12.000Z>
STM: Array2DRowRealMatrix{
{1.0004023047,-0.0003127657,0.0007845252,30.0039321967,-0.0031105506,0.0078646566,0.0001188612,0.0},
{-0.0003127673,0.9995329455,-0.0002529566,-0.0031105041,29.9953276878,-0.0025456392,0.0000030995,0.0},
{0.0007845358,-0.0002529588,1.0000650728,0.0078647062,-0.0025455835,30.0007419226,-0.0001462097,0.0},
{0.0000262276,-0.0000207386,0.0000524332,1.0003842328,-0.0003093393,0.0007883346,0.0000079632,0.0},
{-0.0000207388,-0.0000311428,-0.0000169723,-0.0003093369,0.9995326403,-0.000256167,0.0000001865,0.0},
{0.0000524346,-0.0000169726,0.0000049583,0.0007883436,-0.0002561644,1.0000834412,-0.0000096885,0.0},
{0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0},
{0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0}}>
Note that the two matrices for 2024-09-21T00:22:12.000Z
are identical to the point of numeric error.
Here is the product of the two STM matrices from the case where both data points are accepted:
self.prevStep.date
Out [9]: <AbsoluteDate: 2024-09-21T00:21:42.000Z>
step.date
Out [10]: <AbsoluteDate: 2024-09-21T00:22:12.000Z>
step.stm.multiply(self.prevStep.stm)
Out [7]: <RealMatrix: Array2DRowRealMatrix{
{1.0017542745,-0.001277799,0.0031022626,60.0336353435,-0.0252899048,0.0624105765,0.0004648387,0.0},
{-0.0012778283,0.9981346121,-0.0009852899,-0.0252900019,59.9626637311,-0.0199723021,0.0000172457,0.0},
{0.0031024829,-0.0009853372,1.0001162781,0.0624128524,-0.0199725214,60.0037623929,-0.0005977217,0.0},
{0.0000561619,-0.0000421653,0.0001040331,1.0016107247,-0.0012512061,0.0031376656,0.0000156628,0.0},
{-0.0000421676,-0.0000621815,-0.0000332974,-0.0012512277,0.9981324673,-0.001011867,0.0000004943,0.0},
{0.0001040506,-0.0000333012,0.0000063637,0.0031378825,-0.0010119048,1.0002619545,-0.0000197015,0.0},
{0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0},
{0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0}}>
Here is the STM from the case where I omit the 21:42
measurement from the data set altogether:
step.date
Out [2]: <AbsoluteDate: 2024-09-21T00:22:12.000Z>
step.stm
Out [1]: <RealMatrix: Array2DRowRealMatrix{
{1.0017542743,-0.0012777991,0.003102263,60.0336353362,-0.0252899098,0.0624105922,0.0004649186,0.0},
{-0.0012778285,0.9981346119,-0.0009852901,-0.0252900069,59.9626637242,-0.0199723106,0.0000172489,0.0},
{0.0031024834,-0.0009853374,1.0001162785,0.0624128682,-0.01997253,60.003762407,-0.0005978256,0.0},
{0.0000561619,-0.0000421653,0.0001040331,1.0016107241,-0.0012512064,0.0031376668,0.0000156648,0.0},
{-0.0000421676,-0.0000621815,-0.0000332974,-0.0012512281,0.9981324668,-0.0010118676,0.0000004944,0.0},
{0.0001040506,-0.0000333012,0.0000063637,0.0031378837,-0.0010119055,1.0002619556,-0.000019704,0.0},
{0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0},
{0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0}}>
Again note that the two matrices are identical to the level of numeric error.
While this statement is not as good supporting evidence because you have nothing but my word, I will also say that I have been working on this code for months and that I encountered repeated issues with my backward kalman smoother covariance results (dependent on the STM) until I found an independent means to calculate the STM outside of using the FKF values directly.
As to why the STM calculations would work properly in Java but not in Python, I’m afraid I don’t have enough familiarity with the python binders to even venture a guess. Sorry I cannot be more help.