Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed typo in analyze.py #52

Open
wants to merge 49 commits into
base: 2.2
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
e6d6bc2
fixed typo in analyze.py
miguelzuma Mar 22, 2016
37aaa68
Merge branch '2.2' of https://github.com/baudren/montepython_public i…
Oct 11, 2016
7d72cfc
writes error_log for failed models
Oct 13, 2016
7ed9391
added error codes to record error_log
Oct 14, 2016
5c493d7
fixed conditionals for err_code selection
Dec 6, 2016
7211aa3
fixed missing __init__.py file
Dec 6, 2016
cda0d53
Merge pull request #1 from ardok-m/2.2
miguelzuma Dec 6, 2016
3028656
changes in print_error
Dec 6, 2016
f118410
Merge branch '2.2' of https://github.com/miguelzuma/montepython_zuma …
Dec 6, 2016
e5498ec
commented out CMASS data (use bao_boss_aniso instead)
Dec 6, 2016
1565294
uncommented data: exclusion was made automatic
Dec 7, 2016
17cf1ec
improved input param handling: error with param scale 0
Dec 14, 2016
5a5b782
Merge pull request #2 from ardok-m/debug_scale
miguelzuma Mar 12, 2017
2b26f71
Merge branch '2.2' of https://github.com/baudren/montepython_public i…
Mar 13, 2017
a69f5bc
fixed TypeError np.max for numpy 1.12
Apr 17, 2017
9674a28
fixed contours level error handling.
Apr 18, 2017
68ade95
Merge pull request #3 from ardok-m/2.2
miguelzuma Apr 20, 2017
aa04984
added Planck_compressed likelihood arXiv:1502.01590
May 22, 2017
a6cb593
fix angular diamter distance. Needed comoving
May 22, 2017
a1ce273
separed mean and sigma values
May 23, 2017
a5c6cf2
added triangular prior and fixed some bugs
May 23, 2017
3954be2
changed name of parent likelihood, behavior is the same
May 25, 2017
20cba93
store values as object to be accesible by wic data_mp_likelihoods.py
May 31, 2017
8141385
added only_error optiont to create error file when using NS
Jul 27, 2017
fa8d974
error_log file per chain
Jul 27, 2017
d7513a7
Merge pull request #4 from ardok-m/2.2
miguelzuma Jul 28, 2017
343b5b0
exclude from analysis error_log files
Aug 8, 2017
b86ddd6
fixed missing ''
Sep 14, 2017
b81e791
fixed missing . in suffix
Sep 14, 2017
dd07d3b
Merge pull request #5 from ardok-m/2.2
miguelzuma Sep 25, 2017
f9c3269
modified bao_boss to interact with work_in_class
Oct 11, 2017
40a4a1e
Merge branch '2.2' of https://github.com/baudren/montepython_public i…
Oct 11, 2017
7ac5186
Merge pull request #6 from ardok-m/2.2
miguelzuma Oct 18, 2017
a55a551
updated to match stable CosmoHammer version
Oct 23, 2017
afeb21d
fixed option input cosmo_hammer
Oct 24, 2017
a738c0c
fixed derived CH when not computed
Oct 25, 2017
b70913f
save errors in different file
Oct 25, 2017
50ad150
fixed problems saving errors diff files
Oct 25, 2017
13f0ab7
added function to store derived paramters from cosmo
Oct 27, 2017
47b2fa4
remove nan's from error-log file
Oct 27, 2017
de36365
Merge branch '2.2' of https://github.com/baudren/montepython_public i…
Oct 27, 2017
e418f3b
Merge pull request #7 from ardok-m/2.2
miguelzuma Oct 27, 2017
16085a3
convert to -loglkl the CH loglkl when analyzing
Nov 14, 2017
b040c2f
Merge pull request #8 from ardok-m/2.2
miguelzuma Nov 30, 2017
f8b4142
sort by name the derived parameters (placed at the end of the param l…
May 14, 2018
62315b9
fixed Planck_compressed. Use default CLASS vars
May 28, 2018
81788c5
fixed error storing derived parameters
Jun 20, 2018
bbcedf8
fixed identation in store_cosmo_derived
Jun 20, 2018
a816613
Merge pull request #9 from ardok-m/2.2
miguelzuma Jun 20, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
added Planck_compressed likelihood arXiv:1502.01590
  • Loading branch information
ardok-m committed May 22, 2017
commit aa0498499cad2e5653d09a09845690970d7089e6
24 changes: 24 additions & 0 deletions montepython/likelihoods/Planck_compressed/Planck_compressed.data
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Covriance matrix of the compressed likelihood for Planck TT + lowP
# (arXiv:1502.01590v2, Table 4)
# R, l_A, omega_b, n_s
#Planck_compressed.correlation_matrix = [[1., 0.54, -0.63, -0.86],\ # R
# [0.54, 1., -0.43, -0.48],\ # l_A
# [-0.63, -0.43, 1., 0.58],\ # omega_b
# [-0.86, -0.48, 0.58, 1.]] # n_s

# Covariance matrix_ij = sigma_i sigma_j Correlation_matrix_ij

#Planck_compressed.inverse_correlation_matrix = np.linalg.inv([[1., 0.54, -0.63, -0.86], [0.54, 1., -0.43, -0.48], [-0.63, -0.43, 1., 0.58], [-0.86, -0.48, 0.58, 1.]])

Planck_compressed.inverse_correlation_matrix = [[ 4.51266537, -0.59697118, 0.75581806, 3.15597158], [-0.59697118, 1.43957767, 0.21084593, 0.05531143], [ 0.75581806, 0.21084593, 1.70453221, -0.2374191 ], [ 3.15597158, 0.05531143, -0.2374191 , 3.87838813]]

# mean, std. dev. (sigma)
#Planck_compressed.R = [1.7488, 0.0074]
#Planck_compressed.l_a = [301.76, 0.14]
#Planck_compressed.omega_b = [0.02228, 0.00023]
#Planck_compressed.n_s = [0.9660, 0.0061]

#Planck_compressed.planck_values = np.array([[1.7488, 0.0074], [301.76, 0.14], [0.02228, 0.00023], [0.9660, 0.0061]])
Planck_compressed.planck_values = [[1.7488, 0.0074], [301.76, 0.14], [0.02228, 0.00023], [0.9660, 0.0061]]


34 changes: 34 additions & 0 deletions montepython/likelihoods/Planck_compressed/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
from montepython.likelihood_class import Likelihood_prior
import numpy as np


class Planck_compressed(Likelihood_prior):

# initialisation of the class is done within the parent Likelihood_prior. For
# this case, it does not differ, actually, from the __init__ method in
# Likelihood class.

def loglkl(self, cosmo, data):

z_star = cosmo.z_optical_depth_unity() # z at which the optical depth is unity
D_A_star = cosmo.angular_distance(z_star)
rs_star = cosmo.rs_at_z(z_star)

R = np.sqrt(cosmo.Omega_m()) * cosmo.Hubble(0) * D_A_star
l_a = np.pi * D_A_star / rs_star
omega_b = cosmo.omega_b()
n_s = cosmo.n_s()

values = np.array([R, l_a, omega_b, n_s])
planck_values = zip(*self.planck_values)

# loglkl = -1/2 * (x_i - x_mean_i) * 1/sigma_i * corr_mat_ij^-1 *
# 1/sigma_j * (x_j - x_mean_j)

differences_over_sigma = ((values[:][0] - planck_values[0]) /
planck_values[1])

loglkl = -0.5 * np.dot(differences_over_sigma,
np.dot(self.inverse_correlation_matrix,
differences_over_sigma))
return loglkl