Commit dc52bdd3 authored by Hannah Middleton's avatar Hannah Middleton

log10 freq fix

parent c3553a1b
......@@ -67,11 +67,10 @@ def log_prior(par):
def log_likelihood(par):
M1 = np.linspace(9,12,25)
q = np.linspace(0.25,1,10)
z = np.linspace(0.,1.5,5)
f = frequencies
f = np.atleast_1d([ np.log10(fi) for fi in frequencies ])
initpar = dict(Phi0 = par[0],
PhiI = par[1],
M0 = par[2],
......@@ -95,7 +94,8 @@ def log_likelihood(par):
logL = 0.
for i in range(numberOfFrequencyBinsToUse):
logL += KDEs[i].logpdf(model[i])
return logL
print(model,logL)
return logL[0]
......@@ -119,6 +119,11 @@ bounds=[(-3.4,-2.4),
(0.01,0.99),
(-2.,2.)]
# read in the data
numberOfFrequencyBinsToUse = 5
frequencies, samples = readChains(numberOfFrequencyBinsToUse)
......@@ -126,6 +131,11 @@ frequencies, samples = readChains(numberOfFrequencyBinsToUse)
# make the kdes
KDEs = makeKDEs(samples, numberOfFrequencyBinsToUse)
#parTest = np.array([-2.78,-0.28,11.3,-1.24,-0.04,0.04,0.10,1.27,0.01,0.39,-0.2,-1.91,0.01,8.42,1.03,0.38,0.51,-0.7])
#log_likelihood(parTest)
#exit()
# ptmcmc things
x0 = np.array([-2.8,-0.2,11.25,-1.25,0.,0.025,0.8,0.,0.,1.,0.,-0.5,0.,8.25,1.,0.4,0.5,0.])
ndim = len(x0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment