User:Inyuki/LaTeX notes

Question 1
Q: Draw $$5$$ random numbers from $$\chi_2^2$$ distribution, using its definition.

A: By definition, $$X \sim \chi_2^2 \Leftrightarrow X = Z^2 + Z^2$$, where $$Z \sim \mathcal{N}(0,1)$$.

According to CLT, and some simulation, we see that:

if $$U_i \sim U(0,1)$$ are from uniform distribution,

then approximately $$\sum_{i=1}^{12} U_i - 6 \underset{\mathrm{approx.}}{\sim} \mathcal{N}(0,1)$$.

So, we can draw observations from $$\chi_2^2$$ by $$Z^2 + Z^2 \approx \left(\sum_{i=1}^{12} U_i - 6\right)^2 + \left(\sum_{i=1}^{12} U_i - 6\right)^2$$

Question 2
What is Simpson's paradox?

P-value
The thing is, that


 * $$\textrm{p\mbox{-}value} \Leftrightarrow P(T\le t|H_0)$$ or $$P(T\ge t|H_0)$$

is not equivalent to:


 * $$\textrm{p\mbox{-}value} \Leftrightarrow P(T \in K | H_0)$$

Where $$T$$ is the test statistic, and $$K$$ is critical region, and $$t$$ is the obtained value of test statistic.

I guess, the right definition is in german wikipedia:

In case of right-sided test:
 * $$p_{\text{right}}=P(T\geq t|H_0).$$

In left-sided test:
 * $$p_{\text{left}}=P(T\leq t|H_0).$$

In case of two-sided test:
 * $$p=2\cdot\min(p_{\text{right}},p_{\text{left}}).$$