@@ -791,8 +791,7 @@ def _test(self):
791
791
if len (self .coef_loc_totest ) == 1 :
792
792
self .theta_mle = self .theta_mle [0 ] # Make xarray one dimensional for stats.wald_test.
793
793
self .theta_sd = self .model_estim .fisher_inv [:, self .coef_loc_totest [0 ], self .coef_loc_totest [0 ]]
794
- self .theta_sd = np .nextafter (0 , np .inf , out = self .theta_sd ,
795
- where = self .theta_sd < np .nextafter (0 , np .inf ))
794
+ self .theta_sd = np .nextafter (0 , np .inf , out = self .theta_sd , where = self .theta_sd < np .nextafter (0 , np .inf ))
796
795
self .theta_sd = np .sqrt (self .theta_sd )
797
796
return stats .wald_test (
798
797
theta_mle = self .theta_mle ,
@@ -801,12 +800,11 @@ def _test(self):
801
800
)
802
801
else :
803
802
self .theta_sd = np .diagonal (self .model_estim .fisher_inv , axis1 = - 2 , axis2 = - 1 ).copy ()
804
- self .theta_sd = np .nextafter (0 , np .inf , out = self .theta_sd ,
805
- where = self .theta_sd < np .nextafter (0 , np .inf ))
803
+ self .theta_sd = np .nextafter (0 , np .inf , out = self .theta_sd , where = self .theta_sd < np .nextafter (0 , np .inf ))
806
804
self .theta_sd = np .sqrt (self .theta_sd )
807
805
return stats .wald_test_chisq (
808
806
theta_mle = self .theta_mle ,
809
- theta_covar = self .model_estim .fisher_inv [:, self .coef_loc_totest , self .coef_loc_totest ],
807
+ theta_covar = self .model_estim .fisher_inv [:, self .coef_loc_totest , :][:, :, self .coef_loc_totest ],
810
808
theta0 = 0
811
809
)
812
810
0 commit comments