def setUp(self): self.basic = ddm.Model(dx=.005, dt=.01, T_dur=2, drift=ddm.DriftConstant(drift=.4), noise=ddm.NoiseConstant(noise=1), bound=ddm.BoundConstant(B=1)) class NoiseCond(ddm.Noise): name = "Noise with a condition" required_conditions = ['cond'] required_parameters = [] def get_noise(self, conditions, **kwargs): return conditions["cond"] self.withcond = ddm.Model(noise=NoiseCond()) class FancyBounds(ddm.Bound): name = "Increasing/decreasing bounds" required_conditions = [] required_parameters = [] def get_bound(self, conditions, t, **kwargs): if t <= 1: return 1 + t if t > 1: return 2 / t self.bound = ddm.Model(bound=FancyBounds())
def test_ICPoint(self): """Arbitrary pointwise initial condition""" m = ddm.Model(name='ICPoint_test', drift=ddm.DriftConstant(drift=2), noise=ddm.NoiseConstant(noise=1.5), bound=ddm.BoundConstant(B=1), IC=ddm.ICPoint(x0=-.25)) _modeltest_numerical_vs_analytical(m, method="implicit", max_diff=.3, mean_diff=.2, prob_diff=.05)
def setUp(self): self.basic = ddm.Model(dx=.005, dt=.01, T_dur=2, drift=ddm.DriftConstant(drift=.4), noise=ddm.NoiseConstant(noise=1), bound=ddm.BoundConstant(B=1)) class NoiseCond(ddm.Noise): name = "Noise with a condition" required_conditions = ['cond'] required_parameters = [] def get_noise(self, conditions, **kwargs): return conditions["cond"] self.withcond = ddm.Model(noise=NoiseCond())