How Do I Set.Seed for simulation in R to attain reproducibility on Windows OS
问题 I have a simulation done with the below function in R : ## Load packages and prepare multicore process library(forecast) library(future.apply) plan(multisession) library(parallel) library(foreach) library(doParallel) n_cores <- detectCores() cl <- makeCluster(n_cores) registerDoParallel(cores = detectCores()) set.seed(1) bootstrap1 <- function(n, phi){ ts <- arima.sim(n, model = list(ar=phi, order = c(1, 1, 0)), sd = 1) #ts <- numeric(n) #ts[1] <- rnorm(1) #for(i in 2:length(ts)) # ts[i] <- 2