コード例 #1
0
ファイル: test_smc_step.py プロジェクト: mdruger/SMCPy
def mixed_weight_particle_list():
    p_list = [
        Particle({
            'a': 1,
            'b': 2
        }, i, -.2) for i in np.arange(.1, .5, .1)
    ]
    return p_list
コード例 #2
0
ファイル: test_hdf5.py プロジェクト: mdruger/SMCPy
def particle():
    particle = Particle({'a': 1, 'b': 2}, 0.2, -0.2)
    return particle
コード例 #3
0
 def when_wrong_weight_type(self):
     bad_weight_type = 'bad'
     return Particle(self.params, bad_weight_type, self.log_like)
コード例 #4
0
 def when_zero_log_like(self):
     edge_case_log_like = 0.0
     return Particle(self.params, self.log_weight, edge_case_log_like)
コード例 #5
0
 def when_pos_log_like(self):
     pos_log_like = 0.1
     return Particle(self.params, self.log_weight, pos_log_like)
コード例 #6
0
 def when_wrong_param_type(self):
     bad_param_type = [1, 2]
     return Particle(bad_param_type, self.log_weight, self.log_like)
コード例 #7
0
 def when_good_particle(self):
     return Particle(self.params, self.log_weight, self.log_like)
コード例 #8
0
def particle_list():
    particle = Particle({'a': 1, 'b': 2}, 0.2, -0.2)
    return 5 * [particle]
コード例 #9
0
ファイル: test_smc_step.py プロジェクト: mdruger/SMCPy
def linear_particle_list():
    a = np.arange(0, 20)
    b = [2 * val + np.random.normal(0, 1) for val in a]
    w = 0.1
    p_list = [Particle({'a': a[i], 'b': b[i]}, w, -.2) for i in a]
    return p_list
コード例 #10
0
ファイル: test_smc_step.py プロジェクト: mdruger/SMCPy
def mixed_particle_list():
    particle_1 = Particle({'a': 1, 'b': 2}, -0.2, -0.2)
    particle_2 = Particle({'a': 2, 'b': 4}, -0.2, -0.2)
    list_1 = [particle_1.copy() for i in range(3)]
    list_2 = [particle_2.copy() for i in range(2)]
    return list_1 + list_2
コード例 #11
0
ファイル: test_smc_step.py プロジェクト: mdruger/SMCPy
def particle_list():
    particle = Particle({'a': 1, 'b': 2}, 0.2, -0.2)
    return [particle.copy() for i in range(5)]