Skip to content

Commit aad7374

Browse files
SN likelihood corrected
1 parent b1eb92c commit aad7374

File tree

6 files changed

+264
-18
lines changed

6 files changed

+264
-18
lines changed

Notebooks/likelihood.ipynb

+257-11
Large diffs are not rendered by default.

marcia/backend/cosmology.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def sound_horizon(H0,Omega_b,Omega_m,Obsample):
3838

3939
@njit([f8[:](f8[:])])
4040
def z_inp(z):
41-
return np.arange(0.,np.max(z)+.5,0.01)
41+
return np.arange(0.,np.max(z)+.5,0.001)
4242

4343
@njit
4444
def interpolate(z_inp,z,func):
@@ -55,4 +55,4 @@ def transverse_distance(H0,Omega_m,Omega_b,Omega_k,de,z,clight):
5555

5656
@njit
5757
def distance_modulus(Mb,z2,d):
58-
return Mb + 25. + 5.*np.log10( (1+ z2)* d )
58+
return Mb + 25. + 5.*np.log10( (1+ z2) * d )

marcia/cosmology.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ def distance_modulus(self,parameters,z1, z2):
128128
mu = cbackend.distance_modulus(Mb,z2,d)
129129
else:
130130
# This is useful if only SN data is needed to be used
131-
Mb = -19.05
131+
Mb = -19.2
132132
d = self.transverse_distance(parameters, z1)
133133
mu = cbackend.distance_modulus(Mb,z2,d)
134134
return mu

marcia/likelihood.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def chisq_BAO_alam(self,theta):
5050
def chisq_Pantheon_plus(self,theta):
5151
cmb_z, mb, covariance = self.db.get_pantheon_plus()
5252
helio_z = self.db.get_pantheon_plus(Zhel=True)
53-
distance_theory = self.theory.distance_modulus(theta, cmb_z,helio_z)
53+
distance_theory = self.theory.distance_modulus(theta, cmb_z, helio_z)
5454
delta = mb - distance_theory
5555
if 'Pantheon_plus' in self.inv_covariance.keys():
5656
icov = self.inv_covariance['Pantheon_plus']

marcia/params.ini

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ fc = '$f_c$'
1818
[Priors]
1919
r_d = [100.0,180.0]
2020
M_b = [-20.0,-18.0]
21-
Omega_b = [0.01,0.05]
22-
H0 = [61.0,76.0]
21+
Omega_b = [0.01,0.1]
22+
H0 = [61.0,81.0]
2323
Omega_m = [0.1,0.5]
2424
w = [-2.5,0.5]
2525
Omega_k = [-0.7,0.6]

marcia/sampler.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def __init__(self,model,parameters,data,initial_guess,prior_file=None,max_n=1000
2828

2929

3030
def MLE(self,verbose=True):
31-
nll = lambda x: -self.likelihood.logProb(x)
31+
nll = lambda x: -1*self.likelihood.logProb(x)
3232
result = op.minimize(nll, x0=self.initial_guess, method = 'Nelder-Mead', options={'maxfev': None})
3333
if verbose:
3434
print(f'Best-fit values: {result.x}')

0 commit comments

Comments
 (0)