CS1B 201909 1iv)

Discussion in 'CS1' started by singingmyblues, Feb 24, 2024.

Tags:
  1. singingmyblues

    singingmyblues Keen member

    The question asks us to comment on the difference between confidence intervals, created in a bootstrap vs parametric way. Why would you say the bootstrap CI is smaller is because the distribution of X is not normal (the examiner report says this)? I think it can be because the bootstrap is using a bigger sample of 10000 (the bootstrapped sample created using replicate) whereas the t.test sample is just length(x)
     
  2. singingmyblues

    singingmyblues Keen member

    another question in 201909
    3iv) I seem to get different results running

    set.seed(2019)
    y = 0*(1:1000) # generate a vector of size 1000
    for (i in 1:1000){
    y = sum(rexp(15, 2))
    }

    and
    set.seed(2019)

    # Parameters
    n <- 15
    lambda <- 2
    B <- 1000

    # Generate Bootstrap samples
    bootstrap_samples_Y <- replicate(B, sum(sample(rexp(n, lambda), replace = TRUE)))
     

Share This Page