- evan.biederstedt at gmail
- @ebiederstedt
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The -2 log-likelihood | |
# | |
# -2lnL \propto m^T C^-1 m + ln det C + N ln (2pi) | |
# | |
# First term, m^T C^-1 m is the "model fit term" | |
# Second term, lndetC is the "complexity penalty" | |
# Third term, N ln 2pi, a constant | |
# | |
# m = tempval | |
# C = Sij + N_ij |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Repeat of https://gist.github.com/evanbiederstedt/a763375f068b05167c26 | |
with vector array of shape (3072,), mean=0, variance=1 | |
tempp = np.random.normal(0.0, 1.0, 3072) # mean = 0, std = 1 = var = 1 | |
# Test 1 | |
vary_x_samples125 = np.logspace(-8, -12, num=40) # C3 parameter, vary from e-08 to e-12 | |
sigma125 = 5e-22 # chose this sigma^2 parameter, hold constant | |
#FIRST, NO PEAK CODE, i.e. scale covariance matrix by e+21 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CODE: | |
"""" | |
# | |
# Create an array shaped (3000,), mean = 0.0, variance = 1.0, and compute a_lm values. | |
# use np.random.normal(mean, std, size) | |
# http://docs.scipy.org/doc/numpy/reference/generated/numpy.random.normal.html | |
# | |
hoggarray = np.random.normal(0.0, 1.0, 3072) # mean = 0, std = 1 = var = 1 | |
print hoggarray |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Same as https://gist.github.com/evanbiederstedt/72b0035ca4b9fce830c3 | |
except vary C3, hold sigma^2 fixed | |
FIRST, NO PEAK CODE, i.e. scale covariance matrix by e+21 | |
CODE | |
"""" | |
# | |
# Hold sigma^2 constant, vary C3 | |
# | |
vary_x_samples125 = np.logspace(-8, -12, num=40) # C3 parameter, vary from e-08 to e-12 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
tempp = (1e6)*tempval # multiply CMB maps by 1e6 | |
print tempp.shape # array shape | |
OUTPUT: | |
(3072,) | |
print np.median(tempp) # median | |
OUTPUT: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FIRST, FIND NO PEAK IN LF, NOISE PARAMETERS E-21 TO E-23 | |
CODE: | |
"""" | |
vary_x_samples125 = np.logspace(-8, -12, num=40) #num = 40 | |
sigma125 = np.logspace(-21, -23, num=40) | |
Sij = vary_x_samples125[:, None, None] * norm_matrix[1][None, :, :] | |
newSij = (1e21)*Sij # multiply S_ij by 1e12 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
C3_sample1 = 4e-8 | |
sigma2samples1 = np.linspace(1e-22, 6e-23, num=40) | |
# param is our parameter, C_3 | |
Sij = C3_sample1 * norm_matrix[1][None, :, :] | |
newSij = (1e22)*Sij # multiply S_ij by 1e12 | |
Nij = sigma2samples1[:, None, None] * id_mat[None, :, :] | |
newNij = (1e22)*Nij | |
# Format 7/4pi * param * P_3(M) where param is the parameter we vary, C_l |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
testmattt = Sij[13] | |
testmattt_inv = np.linalg.inv(Sij[13]) | |
print testmattt | |
OUTPUT | |
[[ 3.60611595e-10 3.54999009e-10 3.49422963e-10 ..., -3.54999009e-10 | |
-3.60611595e-10 -3.54999009e-10] | |
[ 3.54999009e-10 3.60611595e-10 3.54999009e-10 ..., -3.49422963e-10 | |
-3.54999009e-10 -3.60611595e-10] |