6

我正在尝试通过DEoptim以下方式在 R 中使用

fit <- DEoptim(fn = .obj, lower=lower, upper = upper, 
                control = list(itermax = 100, trace = 1, parallelType = 1, 
                               steptol = 25, reltol = 1e-9, strategy = 6))

但是,DEoptim在并行设置中使用不会在多次运行中重现结果。使用 .串行运行代码时,我没有这个问题parallelType = 0。我尝试在集群中设置种子clusterSetRNGStream以及在代码中使用set.seed,但这也无济于事。

有没有人在尝试DEoptim并行运行时遇到过类似的问题。下面是sessionInfo

sessionInfo()
R version 3.2.1 (2015-06-18)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1

locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252    LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C                           LC_TIME=English_United States.1252    

attached base packages:
[1] grid      stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] mcGlobaloptim_0.1 doSNOW_1.0.12     iterators_1.0.7   foreach_1.4.2     snow_0.3-13       robust_0.4-16     rrcov_1.3-8       robustbase_0.92-5
[9] MASS_7.3-43       fit.models_0.5-10 lattice_0.20-33   DEoptim_2.2-3     Matrix_1.2-2      covmat_0.1        RMTstat_0.3       mvtnorm_1.0-3    

loaded via a namespace (and not attached):
 [1] Rcpp_0.12.0                   vcd_1.4-1                     class_7.3-13                  zoo_1.7-12                   
 [5] rngWELL_0.10-3                digest_0.6.8                  lmtest_0.9-34                 VIM_4.3.0                    
 [9] plyr_1.8.3                    chron_2.3-47                  fBasics_3011.87               lars_1.2                     
[13] fGarch_3010.82                stats4_3.2.1                  pcaPP_1.9-60                  e1071_1.6-6                  
[17] ggplot2_1.0.1                 PortfolioAnalytics_1.0.3636   minqa_1.2.4                   data.table_1.9.4             
[21] SparseM_1.6                   car_2.0-25                    nloptr_1.0.4                  factorAnalytics_2.0.20       
[25] proto_0.3-10                  splines_3.2.1                 randtoolbox_1.16              lme4_1.1-8                   
[29] CerioliOutlierDetection_1.0.8 stringr_1.0.0                 RCurl_1.95-4.7                munsell_0.4.2                
[33] numDeriv_2014.2-1             mnormt_1.5-3                  mgcv_1.8-7                    nnet_7.3-10                  
[37] gridExtra_2.0.0               codetools_0.2-14              bitops_1.0-6                  leaps_2.9                    
[41] nlme_3.1-121                  gtable_0.1.2                  magrittr_1.5                  scales_0.2.5                 
[45] PerformanceAnalytics_1.4.3541 stringi_0.5-5                 sn_1.2-3                      reshape2_1.4.1               
[49] sp_1.1-1                      timeDate_3012.100             strucchange_1.5-1             lhs_0.10                     
[53] xts_0.9-7                     boot_1.3-17                   sandwich_2.3-3                bestglm_0.34                 
[57] tools_3.2.1                   DEoptimR_1.0-3                parallel_3.2.1                pbkrtest_0.4-2               
[61] colorspace_1.2-6              cluster_2.0.3                 timeSeries_3012.99            corrplot_0.73 
4

0 回答 0