示例#1
0
def test_setup():
    """ Load a model from example dir and set it up with new interface"""
    import os
    test_dir = os.path.dirname(os.path.abspath(__file__))

    dm = dismod_mr.load(test_dir + '/example_data')

    dm.setup_model(rate_type='p', rate_model='neg_binom')
示例#2
0
def test_setup():
    """ Load a model from example dir and set it up with new interface"""
    import os
    test_dir = os.path.dirname(os.path.abspath(__file__))

    dm = dismod_mr.load(test_dir + '/example_data')

    dm.setup_model(rate_type='p', rate_model='neg_binom')
示例#3
0
models = {}
# iter=101; burn=0; thin=1  # use these settings to run faster
iter = 10000
burn = 5000
thin = 5  # use these settings to make sure MCMC converges

# <markdowncell>

# # Consistent fit with all data
#
# Let's start with a consistent fit of the simulated PD data.  This includes data on prevalence, incidence, and SMR, and the assumption that remission rate is zero.  All together this counts as four different data types in the DisMod-II accounting.

# <codecell>

model = dismod_mr.load('/homes/abie/notebook/pd_sim_data/')
model.keep(areas=['GBR'], sexes=['female', 'total'])

# <codecell>

model.setup_model()
%time model.fit(iter=iter, burn=burn, thin=thin)

# <codecell>

models['p, i, r, smr'] = model
model.plot()

# <markdowncell>

# # Consistent fit without incidence
示例#4
0
# <codecell>

models = {}
#iter=101; burn=0; thin=1  # use these settings to run faster
iter=10000; burn=5000; thin=5  # use these settings to make sure MCMC converges

# <markdowncell>

# # Consistent fit with all data
# 
# Let's start with a consistent fit of the simulated PD data.  This includes data on prevalence, incidence, and SMR, and the assumption that remission rate is zero.  All together this counts as four different data types in the DisMod-II accounting.

# <codecell>

model = dismod_mr.load('/homes/abie/notebook/pd_sim_data/')
model.keep(areas=['GBR'], sexes=['female', 'total'])

# <codecell>

model.setup_model()
%time model.fit(iter=iter, burn=burn, thin=thin)

# <codecell>

models['p, i, r, smr'] = model
model.plot()

# <markdowncell>

# # Consistent fit without incidence
示例#5
0
def test_setup():
    """ Load a model from example dir and set it up with new interface"""
    dm = dismod_mr.load(dismod_mr.testing.get_test_data_dir())

    dm.setup_model(rate_type='p', rate_model='neg_binom')