コード例 #1
0
 def _estimate_scale(self, resid):
     """
     Estimates the scale based on the option provided to the fit method.
     """
     if isinstance(self.scale_est, str):
         if self.scale_est.lower() == 'mad':
             return scale.mad(resid)
         if self.scale_est.lower() == 'stand_mad':
             return scale.stand_mad(resid)
     elif isinstance(self.scale_est, scale.HuberScale):
         return scale.hubers_scale(self.df_resid, self.nobs, resid)
     else:
         return scale.scale_est(self, resid)**2
コード例 #2
0
 def _estimate_scale(self, resid):
     """
     Estimates the scale based on the option provided to the fit method.
     """
     if isinstance(self.scale_est, str):
         if self.scale_est.lower() == 'mad':
             return scale.mad(resid)
         if self.scale_est.lower() == 'stand_mad':
             return scale.stand_mad(resid)
     elif isinstance(self.scale_est, scale.HuberScale):
         return scale.hubers_scale(self.df_resid, self.nobs, resid)
     else:
         return scale.scale_est(self, resid)**2
コード例 #3
0
ファイル: test_scale.py プロジェクト: zzzz123321/pygwr
 def test_axisneg1(self):
     m = scale.stand_mad(self.X, axis=-1)
     assert_equal(m.shape, (40, 10))
コード例 #4
0
ファイル: test_scale.py プロジェクト: zzzz123321/pygwr
 def test_axis1(self):
     m = scale.stand_mad(self.X, axis=1)
     assert_equal(m.shape, (40, 30))
コード例 #5
0
ファイル: test_scale.py プロジェクト: zzzz123321/pygwr
 def test_axis0(self):
     m = scale.stand_mad(self.X, axis=0)
     assert_equal(m.shape, (10, 30))
コード例 #6
0
ファイル: test_scale.py プロジェクト: zzzz123321/pygwr
 def test_stand_mad(self):
     m = scale.stand_mad(self.X)
     assert_equal(m.shape, (10, ))
コード例 #7
0
ファイル: test_scale.py プロジェクト: zzzz123321/pygwr
 def test_stand_mad(self):
     assert_almost_equal(scale.stand_mad(self.chem), 0.52632, DECIMAL)
コード例 #8
0
ファイル: test_scale.py プロジェクト: bolliger32/pygwr
 def test_axisneg1(self):
     m = scale.stand_mad(self.X, axis=-1)
     assert_equal(m.shape, (40,10))
コード例 #9
0
ファイル: test_scale.py プロジェクト: bolliger32/pygwr
 def test_axis1(self):
     m = scale.stand_mad(self.X, axis=1)
     assert_equal(m.shape, (40,30))
コード例 #10
0
ファイル: test_scale.py プロジェクト: bolliger32/pygwr
 def test_axis0(self):
     m = scale.stand_mad(self.X, axis=0)
     assert_equal(m.shape, (10,30))
コード例 #11
0
ファイル: test_scale.py プロジェクト: bolliger32/pygwr
 def test_stand_mad(self):
     m = scale.stand_mad(self.X)
     assert_equal(m.shape, (10,))
コード例 #12
0
ファイル: test_scale.py プロジェクト: bolliger32/pygwr
 def test_stand_mad(self):
     assert_almost_equal(scale.stand_mad(self.chem), 0.52632, DECIMAL)