コード例 #1
0
ファイル: uniform.py プロジェクト: vishalbelsare/pybasicbayes
 def resample(self, data=[], niter=5):
     if len(data) == 0:
         self.low = -sample_pareto(-self.x_m_low, self.alpha_low)
         self.high = sample_pareto(self.x_m_high, self.alpha_high)
     else:
         for itr in range(niter):
             # resample high, fixing low
             self.x_m, self.alpha = self.x_m_high, self.alpha_high
             super(Uniform, self).resample(data)
             # tricky: flip data and resample 'high' again
             self.x_m, self.alpha = -self.x_m_low, self.alpha_low
             self.low, self.high = self.high, self.low
             super(Uniform, self).resample(self._flip_data(data))
             self.low, self.high = self.x_m_low - self.high, self.low
コード例 #2
0
ファイル: uniform.py プロジェクト: ariddell/pybasicbayes
 def resample(self,data=[],niter=5):
     if len(data) == 0:
         self.low = -sample_pareto(-self.x_m_low,self.alpha_low)
         self.high = sample_pareto(self.x_m_high,self.alpha_high)
     else:
         for itr in xrange(niter):
             # resample high, fixing low
             self.x_m, self.alpha = self.x_m_high, self.alpha_high
             super(Uniform,self).resample(data)
             # tricky: flip data and resample 'high' again
             self.x_m, self.alpha = -self.x_m_low, self.alpha_low
             self.low, self.high = self.high, self.low
             super(Uniform,self).resample(self._flip_data(data))
             self.low, self.high = self.x_m_low - self.high, self.low
コード例 #3
0
ファイル: uniform.py プロジェクト: vishalbelsare/pybasicbayes
 def resample(self, data=[]):
     self.high = sample_pareto(*self._posterior_hypparams(
         *self._get_statistics(data)))
     return self
コード例 #4
0
ファイル: uniform.py プロジェクト: ariddell/pybasicbayes
 def resample(self,data=[]):
     self.high = sample_pareto(
         *self._posterior_hypparams(*self._get_statistics(data)))
     return self