예제 #1
0
def test_DARCDesign_delayed_and_risky_instantiation():
    D = DesignSpaceBuilder(DA=[0.],
                           DB=[7., 30, 30 * 6, 365],
                           PA=[1.],
                           PB=[0.1, 0.25, 0.5, 0.75, 0.8, 0.9, 0.99],
                           RA=list(100 * np.linspace(0.05, 0.95, 91)),
                           RB=[100.]).build()
    design_thing = BayesianAdaptiveDesignGeneratorDARC(D, max_trials=3)
    assert isinstance(design_thing, BayesianAdaptiveDesignGeneratorDARC)
예제 #2
0
def test_DARCDesign_delay_magnitude_effect_instantiation():
    '''When we are investigating the magnitide effect, we want to ask for a
    reasonable range of DB values. When we do this, we are going to provide
    a vector of proportions (RA_over_RB) which will be translated into
    actual RA values. '''
    D = DesignSpaceBuilder(RB=[10., 100., 1_000.],
                           RA_over_RB=np.linspace(0.05, 0.95,
                                                  19).tolist()).build()
    design_thing = BayesianAdaptiveDesignGeneratorDARC(D, max_trials=3)
    assert isinstance(design_thing, BayesianAdaptiveDesignGeneratorDARC)
예제 #3
0
def test_DARCDesign_risky_initial_design_space():
    D = DesignSpaceBuilder(DA=[0],
                           DB=[0],
                           PA=[1],
                           PB=[0.1, 0.25, 0.5, 0.75, 0.8, 0.9, 0.99],
                           RA=list(100 * np.linspace(0.05, 0.95, 91)),
                           RB=[100]).build()
    design_thing = BayesianAdaptiveDesignGeneratorDARC(D, max_trials=3)
    n_designs = design_thing.all_possible_designs.shape[0]
    assert n_designs > 10
def test_model_design_integration_delayed(model):
    '''Tests integration of model and design. Basically conducts Parameter
    Estimation'''

    D = DesignSpaceBuilder(RA=list(100 * np.linspace(0.05, 0.95, 19))).build()
    design_thing = BayesianAdaptiveDesignGeneratorDARC(D,
                                                       max_trials=max_trials)

    model = model(n_particles=n_particles)
    model = model.generate_faux_true_params()

    simulated_experiment_trial_loop(design_thing, model)
예제 #5
0
def test_DARCDesign_delay_instantiation():
    D = DesignSpaceBuilder(RA=list(100 * np.linspace(0.05, 0.95, 91)),
                           RB=[100.]).build()
    design_thing = BayesianAdaptiveDesignGeneratorDARC(D, max_trials=3)
    assert isinstance(design_thing, BayesianAdaptiveDesignGeneratorDARC)
예제 #6
0
def test_DARCDesign_default_instantiation():
    D = DesignSpaceBuilder(RA=list(100 * np.linspace(0.05, 0.95, 91))).build()
    design_thing = BayesianAdaptiveDesignGeneratorDARC(D)
    assert isinstance(design_thing, BayesianAdaptiveDesignGeneratorDARC)
예제 #7
0
def test_DARCDesign_delay_initial_design_space():
    D = DesignSpaceBuilder(RA=list(100 * np.linspace(0.05, 0.95, 91))).build()
    design_thing = BayesianAdaptiveDesignGeneratorDARC(D)
    n_designs = design_thing.all_possible_designs.shape[0]
    assert n_designs > 10