How to use the simdkalman.primitives.smooth function in simdkalman

To help you get started, we’ve selected a few simdkalman examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github oseiskar / simdkalman / tests / testsuite.py View on Github external
def test_smooth(self):

        mean = np.array([[1],[2],[3]])
        covariance = np.eye(3)*2

        next_mean =  np.array([[2],[4],[6]])
        next_covariance = np.eye(3)

        state_transition = np.eye(3)*0.5
        process_noise = np.eye(3)*0.1

        ms, Ps = primitives.smooth(
            mean,
            covariance,
            state_transition,
            process_noise,
            next_mean,
            next_covariance)

        self.assertSequenceEqual(ms.shape, (3,1))
        self.assertSequenceEqual(Ps.shape, (3,3))

        # should be diagonal
        self.assertTrue(np.linalg.norm(Ps - np.diag(np.diag(Ps))) < 1e-6)