# 宇宙学中的统计方法【甲】

## 基本概念

If you have an urn with N red balls and M blue balls and you draw one ball at the time then probability theory can tell you what are your chances of picking a red ball given that you have already drawn n red and m blue: P(D|H). However this is not what you want to do: you want to make a few drawn from the urn and use probability theory to tell you what is the red vs blue distribution inside the urn: P(H|D). In the Frequentist approach all you can compute is P(D|H).

## Likelihood 的例子

Modern Cosmology 中（337页）取一个例子，稍加修改。算是一段插曲。

$P[D|\theta(\theta_0,\sigma)] \equiv \scr L(D,\theta(\theta_0,\sigma)) = \frac {1}{ \sqrt{2\pi\sigma^2}} exp\left({-\frac{(\theta – \theta_0)^2}{2\sigma^2}}\right)$

$\scr L(D,\theta(\theta_0,\sigma)) = \frac {1}{ (2\pi\sigma^2)^{N/2}} exp\left({-\frac{\sum^{N}_{i=1}(\theta_i – \theta_0)^2}{2\sigma^2}}\right)$

$P[A\cap B] = P[A|B]P[B] = P[B|A]P[A]$

$P[\theta(\theta_0,\sigma)|D] = \frac{ P[D|\theta(\theta_0,\sigma)P[\theta(\theta_0,\sigma)]] }{ P[D] }$

$P[\theta(\theta_0,\sigma)] \sim \scr L$

$\frac{\partial \scr L}{\partial {\theta_0}} = \frac{\sum^N_{i=1} (\theta_i – \theta_0) }{ \sigma^2 (2\pi\sigma^2)^{N/2} } \exp \left( -\frac{\sum^N_{i=1} (\theta_i – \theta_0)}{2\sigma^2} \right)$

$\sum^N_{i=1}(\theta_i – \theta_0) = 0$

$\frac{\partial \scr L}{\partial \sigma} = \scr L \left( -\frac{N}{2\sigma^2} + \frac{\sum^N_{i=1} (\theta_i – \theta_0)^2 }{2\sigma^4} \right)$

$\sigma^2 = \frac{\sum^N_{i=1} (\theta_i – \theta_0) }{ N }$

$\exp\left( – \frac{(\theta_N – \frac 1 2 \theta_0)}{\sigma^{2/N}} – \cdots \right) = \exp\left( – \frac{(\theta_N – \theta_0)}{(2\sigma)^{2/N}}\right) \cdots \exp\left( – \frac{(\theta_1 – \theta_0)}{(2\sigma)^{2/N}}\right)$

$\scr L = \frac{1}{\sqrt {2\pi C_N}} \exp\left( -\frac{(\theta – \bar\theta)}{2C_N} \right)$

## $$\chi^2$$ fit / Chisquare fit

• 观测数据。这里我们使用1a超新星的例子。我们有这样一堆数据：超新星名字，超新星红移 $$zo$$，超新星亮度/distance modulus $$do$$，超新星的distance modulus error $$e$$.

• 理论模型。这里使用最简单的 LCDM 作为例子。理论上可以计算红移对应的距离 $$dt(z,H0,\Omega m0,\Omega d0,\Omega k0) = c\cdot (1+z)\int \frac{1}{H0\sqrt{\Omega m0 (1+zz)^3 + \Omega d0 + \Omega k0(1+zz)^2}}\mathrm d zz$$
实际上 $$dt$$ 并没有那么多独立参量。比如我们可以这样建立各个参量之间的关系：
\begin{eqnarray}
\Omega m0 + \Omega d0 +\Omega k0 &=& 1 \\
\end{eqnarray}
如果是一个平坦的宇宙，那么我们还可以把 $$\Omega k0$$ 设成 0 . 为了适应不同的情况，我们就抽象的写成 $$dt(z,x1,x2,…)$$. $$z$$是变量。

\chi^2(x1,x2) = \sum_{l} \frac{(do[i] – dt(z[i],x1,x2,…))^2}{\sigma_i^2}