예제 #1
0
    args = parser.parse_args()
    sampler = args.sampler[0]
    file_conf = args.config_file[0]

    config_in = pyorbit.yaml_parser(file_conf)

    sampler_keyword = {
        'multinest': ['multinest', 'MultiNest', 'multi'],
        'polychord': ['polychord', 'PolyChord', 'polychrod', 'poly'],
        'emcee': ['emcee', 'MCMC', 'Emcee'],
        'dynesty': ['dynesty', 'DyNesty', 'Dynesty', 'DYNESTY'],
        'optimize': ['optimize', 'scipy', 'Optimize', 'OPTIMIZE'],
    }

    if sampler in sampler_keyword['emcee']:
        pyorbit.pyorbit_emcee(config_in)

    if sampler in sampler_keyword['multinest']:
        pyorbit.pyorbit_multinest(config_in)

    if sampler in sampler_keyword['polychord']:
        pyorbit.pyorbit_polychord(config_in)

    if sampler in sampler_keyword['dynesty']:
        pyorbit.pyorbit_dynesty(config_in)

    if sampler in sampler_keyword['optimize']:
        pyorbit.pyorbit_optimize(config_in)

# This line was used to check if imprtation was working
# else:
예제 #2
0
            'nburn': 3000,
            'nsteps': 10000,
            'thin': 100
        },
        'recenter_bounds': True
    }
}

""" PyORBIT emcee is run using the callable interface
Note the two optional keywords:
    'input_datasets' : can be omitted if all the datasets are read from files
    'return_output' : it will give back sampler_population and sampler_lnprobability, either form compatation or from
    saved files
"""

mc, population, prob = pyorbit.pyorbit_emcee(config_in, input_datasets=input_dataset, return_output=True)



""" Retrieving the emcee parameters used to perform the calculation """
nburnin = mc.emcee_parameters['nburn']
nthin = mc.emcee_parameters['thin']

""" burn-inphase is revomed from each chain (remember: there are _nwalkers_ chains for each parameter)
then the chains are flattened - it means that all the chains for a given parameter are mixed together
Same work for the log-probability array -

"""

flat_chain = pyorbit.classes.io_subroutines.emcee_flatchain(population, nburnin, nthin)
flat_lnprob = pyorbit.classes.io_subroutines.emcee_flatlnprob(prob, nburnin, nthin)