# white noise simulator
ARCHmX_simulate_white_noise <- function(shock.distr) {
  if (shock.distr == "Normal") {
    obs <- rnorm(1, 0, 1)
  } else if (shock.distr == "t5") {
    obs <- rt(1, df = 5)
  } else if (shock.distr == "t7") {
    obs <- rt(1, df = 7)      
  } else { # Laplace distribution
    # Use fact that if X,Y ~ U(0,1), then log(X/Y) ~ Laplace(0,1)
    scale_param <- 0.5 # paper does scale parameter 0.5
    x <- runif(1,0,1)
    y <- runif(1,0,1)
    obs <- log(x/y) * scale_param
  }
  return(obs)
} # moved this outside of simulate and added scale param as per paper