File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -62,6 +62,14 @@ def test_preconditioned_system_matrices(dt, iwp):
62
62
assert jnp .allclose (precond @ precond_proc_noice_chol , non_precond_proc_noice_chol )
63
63
64
64
65
+ def test_projection_matrices (iwp ):
66
+ P = iwp .make_projection_matrix (0 )
67
+ assert isinstance (P , jnp .ndarray )
68
+ d , q = iwp .wiener_process_dimension , iwp .num_derivatives
69
+ assert P .shape == (d , q + 1 )
70
+ assert (P == 1 ).sum () == d
71
+
72
+
65
73
def test_reorder_states ():
66
74
# Transition handles reordering
67
75
iwp = tornado .iwp .IntegratedWienerTransition (
Original file line number Diff line number Diff line change @@ -123,7 +123,7 @@ def non_preconditioned_discretize(self, dt):
123
123
124
124
def make_projection_matrix (self , derivative_to_project_onto ):
125
125
"""Creates a projection matrix kron(I_d, e_p)"""
126
- d , q = self .num_derivatives , self .wiener_process_dimension
126
+ d , q = self .wiener_process_dimension , self .num_derivatives
127
127
I_d = jnp .eye (d )
128
128
e_p = jnp .eye (1 , q + 1 , derivative_to_project_onto )
129
129
return jnp .kron (I_d , e_p )
You can’t perform that action at this time.
0 commit comments