.table { width: 80%; margin-left:10%; margin-right:10%; } Project Goals: With this project we will simulate a famoues probability problem. This will not require knowledge of probability or statistics but only the logic to follow the steps in order to simulate this problem. This is one way to solve problems by using the computer.
1 Gambler’s Ruin: Suppose you have a bankroll of $1000 and make bets of $100 on a fair game.
Jackknife for Gamma Parameters Recall our friend the method of moments estimator:
gamma.est <- function(the_data) { m <- mean(the_data) v <- var(the_data) a <- m^2/v s <- v/m return(c(a=a,s=s)) } Jackknife for Gamma Parameters Function Write a function called gamma.jackknife that takes argument a_vector and returns jackknife standard error estimates on the gamma parameters.
gamma.jackknife <- function(a_vector) { n1=length(a_vector) estimate_a=c(n1) estimate_s=c(n1) for(i in 1:n1) { estimate_a[i]=gamma.est(a_vector[-i])[1] estimate_s[i]=gamma.est(a_vector[-i])[2] } se_a=sqrt((var(estimate_a))*((n1-1)^2)/n1) se_s=sqrt((var(estimate_s))*((n1-1)^2)/n1) jackknife.