Conclusion: Dataset looks fine.
In [3]:
%matplotlib inline
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
from matplotlib import rc
from bigmali.grid import Grid
from bigmali.likelihood import BiasedLikelihood
from bigmali.prior import TinkerPrior
from bigmali.hyperparameter import get
from scipy.stats import lognorm
from time import time
rc('text', usetex=True)
In [9]:
tmp = pd.read_csv('mock_data.csv')
In [10]:
tmp.columns
Out[10]:
In [12]:
def log10(a):
return np.log(a) / np.log(10)
plt.scatter(log10(tmp.lum[:200]), log10(tmp.lum_obs[:200]))
plt.xlabel('int')
Out[12]:
In [14]:
plt.scatter(log10(tmp.mass[:200]), log10(tmp.lum[:200]))
plt.xlabel('mass')
Out[14]:
In [19]:
from scipy.stats import norm,lognorm
np.random.seed(0)
alpha1 = norm(10.709, 0.022).rvs()
alpha2 = norm(0.359, 0.009).rvs()
alpha3 = 2.35e14
alpha4 = norm(1.10, 0.06).rvs()
S = norm(0.155, 0.0009).rvs()
mass = tmp.mass
z = tmp.z
sigma_L = 0.05
mu_li = np.exp(alpha1) * ((mass / alpha3) ** (alpha2))* ((1+z) ** (alpha4))
li = lognorm(S, scale=mu_li).rvs()
observed = lognorm(sigma_L, scale=li).rvs()
In [23]:
li[0]
Out[23]:
In [22]:
mu_li[0]
Out[22]:
In [24]:
plt.plot(mu_li[:100])
plt.plot(li[:100])
Out[24]:
In [25]:
plt.plot(mu_li[:100] - li[:100])
Out[25]:
In [27]:
mu_li[0] - li[0]
Out[27]:
In [29]:
lspace = np.linspace(5000, 15000, 1000)
In [34]:
plt.plot(lspace, lognorm(S*2, scale=mu_li[0]).pdf(lspace))
Out[34]:
In [35]:
lognorm(S * np.linspace(1,10,10), scale=mu_li[0]).pdf(li[0])
Out[35]:
In [ ]: