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
Last revisionBoth sides next revision
b:head_first_statistics:using_discrete_probability_distributions [2023/10/01 18:59] – [Theorems] hkimscilb:head_first_statistics:using_discrete_probability_distributions [2023/10/04 10:29] hkimscil
Line 530: Line 530:
 & = 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 590:
 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 616:
 \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 624:
 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 691:
 \end{align} \end{align}
 ====== e.gs in R  ====== ====== e.gs in R  ======
- 
 R에서 이를 살펴보면 R에서 이를 살펴보면
 <code> <code>
-m <- 0 +# variance theorem 4-1, 4-2 
-v <- 4 +# http://commres.net/wiki/variance_theorem 
-n <- 10000+# need a function, rnorm2 
 +rnorm2 <- function(n,mean,sd) { mean+sd*scale(rnorm(n)) } 
 + 
 +m <- 50 
 +v <- 100 
 +n <- 1000000
 set.seed(1) set.seed(1)
 x1 <- rnorm2(n, m, sqrt(v)) x1 <- rnorm2(n, m, sqrt(v))
Line 719: Line 722:
 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 748:
 # 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.txt · Last modified: 2023/10/04 10:29 by hkimscil

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki