Ejemplo n.º 1
0
def chisquared(a0, alphas, invalpha, m0, m12, mb, mt, signmu, tanb):
    """ Wrapper for likelihood.
    Arguments:
    a0, alphas, invalpha, m0, m12, mb, mt, signmu, tanb - nine elements of cube.
    """
    ndim = 9  # Model parameters - 9 for CMSSM.
    nparams = 100  # Approximate number of items in cube.
    cube = [0] * nparams  # Initialise cube as empty list.
    # Copy arguments to cube.
    for i, arg in enumerate([a0, alphas, invalpha, m0, m12, mb, mt, signmu, tanb]):
        cube[i] = arg
    # ndim and nparams are irrelavant.
    chisquared = -2 * Likelihood.myloglike(cube, ndim, nparams)
    return chisquared
Ejemplo n.º 2
0
def chisquared(a0, alphas, invalpha, m0, m12, mb, mt, signmu, tanb):
    """ Wrapper for likelihood.
    Arguments:
    a0, alphas, invalpha, m0, m12, mb, mt, signmu, tanb - nine elements of cube.
    """
    ndim = 9  # Model parameters - 9 for CMSSM.
    nparams = 100  # Approximate number of items in cube.
    cube = [0] * nparams  # Initialise cube as empty list.
    # Copy arguments to cube.
    for i, arg in enumerate(
        [a0, alphas, invalpha, m0, m12, mb, mt, signmu, tanb]):
        cube[i] = arg
    # ndim and nparams are irrelavant.
    chisquared = -2 * Likelihood.myloglike(cube, ndim, nparams)
    return chisquared
Ejemplo n.º 3
0
# Tests an input point, run with
# python Tester.py a0, alphas, invalpha, m0, m12, mb, mt, signmu, tanb

# Superpy modules.
import Debug as DB  # Debug options.
import Likelihood  # Constraints and likelihood functions.

# External modules.
import sys

# Initialise the cube.
cols = 100
nparams = cols - 2  # Subract 2 for chi-squared and posterior weight.
ndim = 10  # For CNMSSM.

# Read the input parameters into the cube.
cube = [0] * nparams  # Initialise cube to an empty list.
# Plust one to ignore first argument is name of file.
if len(sys.argv) != ndim + 1:
    sys.exit("You should supply a0, alphas, invalpha, lambda, m0, m12, mb, mt, signmu, tanb")

for i in range(len(sys.argv)):
    if i == 0:
        continue  # Ignore name of file.
    # Minus one to ignore name of file, which is zeroth argument, and convert
    # string to float.
    cube[i - 1] = float(sys.argv[i])

# Call likelihood function.
loglike = Likelihood.myloglike(cube, ndim, nparams)
Ejemplo n.º 4
0
import Likelihood  # Constraints and likelihood functions.
import PlotMod as PM  # To access this, export PYTHONPATH=$PWD/SuperPlot

# External modules.
import sys

# Check that line number was supplied.
if len(sys.argv) != 2:
    sys.exit('You should supply line number.')

# Open the chain with a GUI.
labels, data = PM.OpenData()
ndim = 10  # Number of model parameters - 10 for CNMSSM.
nparams = 100  # Approximate number of items in cube.

# Read line to re-calculate.
# Plust one to ignore first argument is name of file, e.g. python
# LineProcess.py arg1 etc
linenumber = int(sys.argv[1])  # We need to convert from string to integer.

# Initialise the cube to an empty list - it must be a list, not a dictionary.
cube = [0] * nparams

# Copy model parameters from the *.txt file to the cube.
for i in range(ndim):
    # Plus 2 for chi-squared and posterior weight.
    cube[i] = data[i + 2][linenumber]

# Re-calculate the cube etc with this likelihood function.
loglike = Likelihood.myloglike(cube, ndim, nparams)
Ejemplo n.º 5
0
# parameters, rather than a list.


def chisquared(a0, alphas, invalpha, m0, m12, mb, mt, signmu, tanb, lambda):
    """ Wrapper for likelihood.
    Arguments:
    a0, alphas, invalpha, m0, m12, mb, mt, signmu, tanb, lambda - ten elements of cube.
    """
    ndim = 10  # Model parameters - 10 for CNMSSM.
    nparams = 100  # Approximate number of items in cube.
    cube = [0] * nparams  # Initialise cube as empty list.
    # Copy arguments to cube.
    for i, arg in enumerate([a0, alphas, invalpha, m0, m12, mb, mt, signmu, tanb, lambda]):
        cube[i] = arg
    # ndim and nparams are irrelavant.
    chisquared = -2 * Likelihood.myloglike(cube, ndim, nparams)
    return chisquared

# Setup initial values, errors etc.
kwdarg = dict(
    a0=-3000,
    error_a0=100,
    alphas=1.18400000e-01,
    fix_alphas=True,
    invalpha=1.27944000e+02,
    fix_invalpha=True,
    m0=400,
    error_m0=100,
    m12=900,
    error_m12=100,
    mb=4.18000000e+00,