def PrintInfo(): """ Function to write an info file, for use with plotting, and for saving Multinest options, likelihood functions and priors. """ # Import variable inside function, to avoid circular module # imports. import MNOptions as MN import Priors import Likelihood infofile = MN.outputfiles_basename + '.info' info = open(infofile, 'w') info.write('''# SuperPy info file, with cube indicies. # This info file can be used for plot labels.\n''') for key, value in label.iteritems(): # Add 1 to the keys, so that labelling begins at 1, rather than 0. # This is identical to the SuperBayeS info file convention. key = str(int(key) + 1) info.write('''lab%s=%s\n''' % (key, value)) # Write the prior types and arguements. info.write('''# Priors.\n''') for key in Priors.CNMSSMModelTracker().param: info.write('''%s %s %s\n''' % (key, Priors.CNMSSMModelTracker().param[key].type, Priors.CNMSSMModelTracker().param[key].arg)) # Write the likelihoods types and arguments. info.write('''# Likelihoods.\n''') for key in Likelihood.CNMSSMConstraintTracker().constraint: info.write( '''%s %s %s\n''' % (key, Likelihood.CNMSSMConstraintTracker().constraint[key].type, Likelihood.CNMSSMConstraintTracker().constraint[key].arg)) # Write the MN parameters. info.write('''# MultiNest options.\n''') for vars in dir(MN): if not vars.startswith("__"): info.write('''%s %s\n''' % (vars, getattr(MN, vars))) info.close()
outputfiles_basename = os.path.abspath('./chains/CNMSSM') # These are the settings that are passed to MultiNest. # Loglike callback function. LogLikelihood = Likelihood.myloglike # Prior callback function. Prior = Priors.myprior # Number of model parameters. n_dims = len(Priors.CNMSSMModelTracker().param) # Total number of parameters in cube. # This is model parameters + constraints + chi2 from constraints + 33 # sparticle/particle masses + mu + neutralino mixing. # For NMSSM, neutralino mixing matrix is 5 by 5. # For NMSSM, 2 extra masses for singlet and singlino. n_params = n_dims + 2 * \ len(Likelihood.CNMSSMConstraintTracker().constraint) + 33 + 2 + 1 + 25 # Which parameters to mode cluster, first n. n_clustering_params = 2 # Should be a vector of 1s and 0s - 1 = wrapped, 0 = unwrapped. wrapped_params = None # Whether to separate modes. multimodal = True const_efficiency_mode = False n_live_points = 10 evidence_tolerance = 1.0 sampling_efficiency = 2.0 n_iter_before_update = 1 null_log_evidence = -1e+90 # For memory allocation only, if memory exceeded, MultiNest halts. max_modes = 5 # Seed the random number generator, if -1 seeded from system clock.