expected_value_and_variance_properties

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
expected_value_and_variance_properties [2023/10/04 12:58] – [e.gs in R] hkimscilexpected_value_and_variance_properties [2023/12/07 12:18] (current) – [Theorem 2: Why square] hkimscil
Line 33: Line 33:
  
 \begin{align*} \begin{align*}
-Var[aX] & = E[a^2X^2] − (E[aX])^2 \\ +Var[aX] & = E[a^2X^2] − (E[aX])^2 \\ 
- & = a^2 E[X^2] - (a E[X])^2 \\ + & = a^2 E[X^2] - (a E[X])^2 \\ 
- & = a^2 E[X^2] - (a^2 E[X]^2) \\ + & = a^2 E[X^2] - (a^2 E[X]^2) \\ 
- & = a^2 (E[X^2] - (E[X])^2) \\ + & = a^2 (E[X^2] - (E[X])^2) \\ 
- & = a^2 (Var[X]) \label{var.theorem.2} \tag{variance theorem 2} \\+ & = a^2 (Var[X]) \label{var.theorem.2} \tag{variance theorem 2} \\
 \end{align*} \end{align*}
 ====== Theorem 3: Why Var[X+c] = Var[X] ====== ====== Theorem 3: Why Var[X+c] = Var[X] ======
Line 196: Line 196:
 rnorm2 <- function(n,mean,sd) { mean+sd*scale(rnorm(n)) } rnorm2 <- function(n,mean,sd) { mean+sd*scale(rnorm(n)) }
  
-m <- 0+m <- 50
 v <- 4 v <- 4
 n <- 100000 n <- 100000
Line 210: Line 210:
 m.x2 m.x2
 m.x3 m.x3
 +
 +y1 <- 3*x1 +5 
 +exp.y1 <- mean(y1) 
 +exp.3xplus5 <- 3 * mean(x1) + 5
 +exp.y1
 +exp.3xplus5
  
 v.x1 <- var(x1) v.x1 <- var(x1)
Line 217: Line 223:
 v.x2 v.x2
 v.x3 v.x3
 +
 +var(x1) 
 +var((3*x1)+5)
 +3^2 * var(x1)
  
 v.12 <- var(x1 + x2) v.12 <- var(x1 + x2)
expected_value_and_variance_properties.1696391896.txt.gz · Last modified: 2023/10/04 12:58 by hkimscil

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki