コード例 #1
0
model = MCMCModel(sim, {'a': [-10, 10], 'initial_h': [0, 4]})
model.fit(iter=25000)

# <codecell>

sim.run(0, 12)
model.plot_distributions(show_normal=True)

# <markdowncell>

# ### Plot the simulations for many samplings of the simulation parameters

# <codecell>

sim.noplots = True  # turn off the simulation plots
for i in range(500):
    model.draw()
    sim.run(0, 12)
    plot(sim.t, sim.h, 'g-', alpha=.1)
sim.noplots = False  # gotta love a double-negative
plot(t, h, 'bo')  # plot the data

# <markdowncell>

# ## Logistic Model with the Same Data

# <codecell>

sim = Simulation()
sim.add("h'=a*h*(1-h/K)", 1, plot=True)
コード例 #2
0
model=MCMCModel(sim,{'a':[-10,10],'initial_h':[0,4]})
model.fit(iter=25000)

# <codecell>

sim.run(0,12)
model.plot_distributions(show_normal=True)

# <markdowncell>

# ### Plot the simulations for many samplings of the simulation parameters

# <codecell>

sim.noplots=True  # turn off the simulation plots
for i in range(500):
    model.draw()
    sim.run(0,12)
    plot(sim.t,sim.h,'g-',alpha=.1)
sim.noplots=False  # gotta love a double-negative
plot(t,h,'bo')  # plot the data

# <markdowncell>

# ## Logistic Model with the Same Data

# <codecell>

sim=Simulation()
sim.add("h'=a*h*(1-h/K)",1,plot=True)