def test_overlay_chain_distribution_integrates_to_1(self): """Overlays integrate to 1""" m = ddm.Model(name="Overlay_test", drift=ddm.DriftConstant(drift=2), T_dur=5, overlay=ddm.OverlayChain(overlays=[ ddm.OverlayPoissonMixture(pmixturecoef=.2, rate=2), ddm.OverlayUniformMixture(umixturecoef=.2), ddm.OverlayNonDecision(nondectime=.2) ])) s = m.solve() distsum = s.prob_correct() + s.prob_error() assert .99 < distsum < 1.0001, "Distribution doesn't sum to 1"
dipparam=dipparam, ), noise=NoiseDip( noise=noise, t1=t1, t1slope=t1slope, dipstart=dipstart, dipstop=dipstop, diptype=diptype, ), IC=ICPoint(x0=x0), bound=BoundDip(B=1, dipstart=dipstart, dipstop=dipstop, diptype=diptype), overlay=ddm.OverlayChain(overlays=[ ddm.OverlayNonDecision(nondectime=nondectime), OverlayDipRatio(detect=detect, diptype=diptype), ddm.OverlayPoissonMixture(pmixturecoef=pmixturecoef, rate=rate) ]), dx=0.002, dt=0.002, T_dur=3.0) # END demo ddm.plot.model_gui(model=m, conditions={ "coherence": [50, 53, 60, 70], "presample": [0, 400, 800], "highreward": [0, 1] })