User Tools

Site Tools


b:head_first_statistics:using_discrete_probability_distributions

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
b:head_first_statistics:using_discrete_probability_distributions [2023/10/01 13:08] – [Theorems] hkimscilb:head_first_statistics:using_discrete_probability_distributions [2024/10/01 21:44] (current) – [Fat Dan changed his prices] hkimscil
Line 281: Line 281:
  
 __Pool puzzle__ __Pool puzzle__
 +
 +\begin{eqnarray*}
 +\text {original win} & = & \text {c(0, 5, 10, 15, 20)} \\
 +\text {original cost} & = & \text {c(1)} \\
 +\text {X} & = & \text {the amount of money you receive} \\
 +\end{eqnarray*}
  
 \begin{eqnarray*} \begin{eqnarray*}
Line 295: Line 301:
 E(X) = -.77 and E(Y) = -.85. What is 5 * E(X) + 3? E(X) = -.77 and E(Y) = -.85. What is 5 * E(X) + 3?
  
-$ 5 * E(X) = -3.85 $ +\begin{eqnarray*
-E(X) + 3 = -0.85 $ +E(X) -.77 \\ 
-$ E(Y) = 5 * E(X) + 3 $ +E(Y) & = & E(5X+3) \;\;\;\;\;  \because Y=5X+3 \\ 
 +& = & E(5X) + 3 \\ 
 +& = & 5 E(X) + 3 \\ 
 +-0.85 \\ 
 +\\ 
 +\\ 
 +Var(Y) & Var(5X+3) \\ 
 +& = & Var(5X) + Var(3) \\ 
 +& = & Var(5X) \\ 
 +& = & 5^2 Var(X) \\ 
 +& = & 67.4275  
 +\end{eqnarray*}
  
-$ 5 * Var(X) = 13.4855 $ 
-$ 5^2 * Var(X) = 67.4275 $ 
-$ Var(Y) = 5^2 * Var(X) $ 
  
 \begin{eqnarray*} \begin{eqnarray*}
Line 375: Line 388:
 </code> </code>
  
-그런데 +위는 각각 계산한 것. 아래는 Y = X - 0.5를 적용해서 계산한 것
 \begin{eqnarray*} \begin{eqnarray*}
 E(X-a) & = & E(X) - a \\ E(X-a) & = & E(X) - a \\
Line 507: Line 520:
 | $E(aX - bY)$ | $aE(X)-bE(Y)$  | | $E(aX - bY)$ | $aE(X)-bE(Y)$  |
 | $E(X1 + X2 + X3)$ | $E(X) + E(X) + E(X) = 3E(X) \;\;\; $ ((X1,X2,X3는 동일한 statistics을 갖는 (X의 특성을 갖는, 즉, 집합 X의 동일한 mean, variance, sdev 값을 갖는) 집합))   | | $E(X1 + X2 + X3)$ | $E(X) + E(X) + E(X) = 3E(X) \;\;\; $ ((X1,X2,X3는 동일한 statistics을 갖는 (X의 특성을 갖는, 즉, 집합 X의 동일한 mean, variance, sdev 값을 갖는) 집합))   |
-| $Var(X)$ | $E(X-\mu)^{2} = E(X^{2})-\mu^{2} \;\;\; $   see $\ref{var.theorem.1} $ |+| $Var(X)$ | $E(X-\mu)^{2} = E(X^{2})-E(X)^{2} \;\;\; $   see $\ref{var.theorem.1} $ |
 | $Var(c)$  | $0 \;\;\; $ see $\ref{var.theorem.41}$   | | $Var(c)$  | $0 \;\;\; $ see $\ref{var.theorem.41}$   |
 | $Var(aX + b)$ | $a^{2}Var(X) \;\;\; $  see $\ref{var.theorem.2}$ and $\ref{var.theorem.3}$ | | $Var(aX + b)$ | $a^{2}Var(X) \;\;\; $  see $\ref{var.theorem.2}$ and $\ref{var.theorem.3}$ |
Line 530: Line 543:
 & = E[X^2] - 2 \mu^2 + \mu^2   \nonumber \\ & = E[X^2] - 2 \mu^2 + \mu^2   \nonumber \\
 & = E[X^2] - \mu^2 \nonumber \\ & = E[X^2] - \mu^2 \nonumber \\
-& = E[X^2] - (E[X])^2 \label{var.theorem.1} \tag{variance theorem 1} \\+& = E[X^2] - E[X]^2 \label{var.theorem.1} \tag{variance theorem 1} \\
 \end{align} \end{align}
  
Line 590: Line 603:
 Variance는 기본적으로 아래와 같다. 이 때 $X=c$ 라고 (c=상수) 하면 Variance는 기본적으로 아래와 같다. 이 때 $X=c$ 라고 (c=상수) 하면
 \begin{align} \begin{align}
-Var(X) & = E[(X − E(X))^2] \nonumber \\ +Var(X) & = E[(X − E(X))^2] \text{    because  X = c, and E(X) = c}    \nonumber \\
-& = E[(X − E(X))^2] \text{    because  X = c, and E(X) = c}    \nonumber \\+
 & = E[(c-c)^2] \nonumber  \\  & = E[(c-c)^2] \nonumber  \\ 
 & = 0   \nonumber  \\ & = 0   \nonumber  \\
Line 617: Line 629:
 \begin{align*} \begin{align*}
   &  E[(X + Y)^2] = E[X^2 + 2XY + Y^2] = E[X^2] + 2E[XY] + E[Y^2] \\   &  E[(X + Y)^2] = E[X^2 + 2XY + Y^2] = E[X^2] + 2E[XY] + E[Y^2] \\
-- & [E(X + Y)]^2 = [E(X) + E(Y)]^2 = E(X)^2 + 2E(X)E(Y) + E(Y^2\\+- & [E(X + Y)]^2 = [E(X) + E(Y)]^2 = E(X)^2 + 2E(X)E(Y) + E(Y)^2 \\
 \end{align*} \end{align*}
  
Line 625: Line 637:
 Var[(X+Y)] =  Var[(X+Y)] = 
   & E[X^2] & + & 2E[XY] & + & E[Y^2] \\   & E[X^2] & + & 2E[XY] & + & E[Y^2] \\
-- & E(X)^2 & - & 2E(X)E(Y) & - & E(Y^2\\+- & E(X)^2 & - & 2E(X)E(Y) & - & E(Y)^2 \\
   & Var[X] & + & 2 E[XY]-2E(X)E(Y) & + & Var[Y] \\   & Var[X] & + & 2 E[XY]-2E(X)E(Y) & + & Var[Y] \\
 \end{align*} \end{align*}
Line 692: Line 704:
 \end{align} \end{align}
 ====== e.gs in R  ====== ====== e.gs in R  ======
- 
 R에서 이를 살펴보면 R에서 이를 살펴보면
 <code> <code>
 +# variance theorem 4-1, 4-2
 +# http://commres.net/wiki/variance_theorem
 +# need a function, rnorm2
 +rnorm2 <- function(n,mean,sd) { mean+sd*scale(rnorm(n)) }
 +
 m <- 0 m <- 0
-v <- 4+v <- 1
 n <- 10000 n <- 10000
 set.seed(1) set.seed(1)
Line 719: Line 735:
 v.12 <- var(x1 + x2) v.12 <- var(x1 + x2)
 v.12 v.12
-## should be near 2*v+###################################### 
 +## v.12 should be near var(x1)+var(x2)
 ###################################### ######################################
 ## 정확히 2*v가 아닌 이유는 x1, x2가  ## 정확히 2*v가 아닌 이유는 x1, x2가 
Line 744: Line 761:
 # var(2*x1) = 2^2 var(X1) # var(2*x1) = 2^2 var(X1)
 v.11 v.11
- 
  
 </code> </code>
b/head_first_statistics/using_discrete_probability_distributions.1696133282.txt.gz · Last modified: 2023/10/01 13:08 by hkimscil

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki