Running 'testthat.R' [32s]
Running the tests in 'tests/testthat.R' failed.
Complete output:
  > library(testthat)
  > library(bigKRLS)
  Loading required package: bigmemory
  
  
  bigKRLS is authored by Pete Mohanty (Stanford University) and Robert Shaffer (University of Pennsylvania) under License GPL 3.
  
  To get started, check out vignette("bigKRLS_basics").
  
  If you use this package in your research, kindly cite:
  
  
  Pete Mohanty and Robert Shaffer. 2018. 'Messy Data, Robust Inference? Navigating Obstacles to Inference with bigKRLS.' Political Analysis. Cambridge University Press. DOI=10.1017/pan.2018.33. pages 1-18.
  > 
  > # have to disable R_TESTS environment variable or parallel::makePSOCKcluster hangs.
  > Sys.setenv("R_TESTS" = "")
  > 
  > 
  > test_check("bigKRLS")
  ..........................
  All done. You may wish to use summary() for more detail, predict() for out-of-sample forecasts, or shiny.bigKRLS() to interact with results. For an alternative approach, see help(crossvalidate.bigKRLS). Type vignette("bigKRLS_basics") for sample syntax. Use save.bigKRLS() to store results and load.bigKRLS() to re-open them.
  
  
  
  MODEL SUMMARY:
  
  lambda: 0.1306 
  N: 32 
  N Effective: 15.17858 
  R2: 0.9405 
  R2AME**: 0.8477 
  
  Average Marginal Effects:
  
       Estimate Std. Error t value Pr(>|t|)
  cyl   -0.0733     0.0765 -0.9581   0.3806
  disp  -0.0037     0.0022 -1.6485   0.1582
  hp    -0.0145     0.0040 -3.5903   0.0148
  drat   1.2786     0.6303  2.0287   0.0963
  wt    -1.4940     0.3115 -4.7968   0.0045
  qsec   0.3678     0.1741  2.1123   0.0864
  vs*    1.2772     0.6234  2.0488   0.0938
  am*    0.9967     0.5954  1.6739   0.1530
  gear   1.0847     0.2867  3.7828   0.0120
  carb  -0.5951     0.1518 -3.9200   0.0104
  
  
  Percentiles of Marginal Effects:
  
            5%     25%     50%     75%     95%
  cyl  -0.3219 -0.1071 -0.0182  0.0065  0.0406
  disp -0.0108 -0.0080 -0.0040 -0.0011  0.0044
  hp   -0.0372 -0.0258 -0.0138 -0.0009  0.0038
  drat -0.4892  0.6973  1.1559  2.1076  3.4894
  wt   -3.5756 -1.9904 -1.2308 -0.7641 -0.2853
  qsec -0.1250  0.0504  0.2099  0.5900  1.2423
  vs*  -0.3757  0.8754  1.2843  1.8167  2.6408
  am*  -0.6929  0.3432  0.8767  1.8618  2.7406
  gear -0.4504 -0.1866  0.8420  1.9432  3.4149
  carb -1.1902 -1.0159 -0.5844 -0.2336  0.0107
  
  (*) Reported average and percentiles of dy/dx is for discrete change of the dummy variable from min to max (usually 0 to 1)).
  
  
  (**) Pseudo-R^2 computed using only the Average Marginal Effects.
  
  
  You may also wish to use predict() for out-of-sample forecasts or shiny.bigKRLS() to interact with results. Type vignette("bigKRLS_basics") for sample syntax. Use save.bigKRLS() to store results and load.bigKRLS() to re-open them.
  
  Saving model estimates to:
  
   bigKRLS_test_results 
  
  
  0 matrices saved as big matrices (base R save() may be used safely in this case too).
  Smaller, base R elements of the outputted object saved: bigKRLS_test_results/estimates.RData 
  
  Total file size approximately 0 megabytes.
  .
  model estimates will be saved to:
  
   bigKRLS_test_bigmemory_results 
  
  ................
  saving vcovmatyhat to d:/Rcompile/CRANpkg/local/3.6/bigKRLS.Rcheck/tests_i386/testthat
  vcovmatyhat successfully saved to disk (and removed from memory for speed).
  ..........
  saving output to bigKRLS_test_bigmemory_results 
  	writing bigKRLS_test_bigmemory_results/X.txt ...
  	writing bigKRLS_test_bigmemory_results/K.txt ...
  	writing bigKRLS_test_bigmemory_results/vcov.est.c.txt ...
  	writing bigKRLS_test_bigmemory_results/derivatives.txt ...
  
  
   5 matrices saved as big matrices.
  
  to reload, use syntax like:
  
  load.bigKRLS("d:\RCompile\CRANpkg\local\3.6\bigKRLS.Rcheck\tests_i386\testthat\bigKRLS_test_bigmemory_results")
   or
  load.bigKRLS("d:\RCompile\CRANpkg\local\3.6\bigKRLS.Rcheck\tests_i386\testthat\bigKRLS_test_bigmemory_results", newname="my_estimates")
  
  base R elements of the output saved to estimates.RData.
  Total file size approximately 0 megabytes.
  
  
  All done. You may wish to use summary() for more detail, predict() for out-of-sample forecasts, or shiny.bigKRLS() to interact with results. For an alternative approach, see help(crossvalidate.bigKRLS). Type vignette("bigKRLS_basics") for sample syntax. Use save.bigKRLS() to store results and load.bigKRLS() to re-open them.
  
  	Reading from K.txt 
  	Reading from X.txt 
  	Reading from derivatives.txt 
  	Reading from vcov.est.c.txt 
  NOTE: vcov.est.fitted not found in .RData or in big matrix file, vcov.est.fitted.txt .
  
  ..........................
  Overview of Model Performance
  
  N: 32 
  Seed: 123 
  
                                                     In Sample Out of Sample
  Mean Squared Error (Full Model)                        3.067         4.512
  Mean Squared Error (Average Marginal Effects Only)   241.673       204.649
  Pseudo-R^2 (Full Model)                                0.917         0.850
  Pseudo-R^2 (Average Marginal Effects Only)             0.842         0.888
                                                                            
  N                                                     26.000         6.000
  
  
  Summary of Training Model:
  
  
  MODEL SUMMARY:
  
  lambda: 0.2203 
  N: 26 
  N Effective: 13.31767 
  R2: 0.917 
  R2AME**: 0.8424 
  
  Average Marginal Effects:
  
       Estimate Std. Error t value Pr(>|t|)
  cyl   -0.0707     0.0728 -0.9707   0.3970
  disp  -0.0023     0.0022 -1.0483   0.3648
  hp    -0.0150     0.0038 -3.9729   0.0236
  drat   0.8467     0.6580  1.2868   0.2806
  wt    -1.3875     0.2990 -4.6396   0.0151
  qsec   0.3421     0.1685  2.0300   0.1265
  vs*    1.4893     0.6266  2.3770   0.0896
  am*    1.2569     0.6508  1.9311   0.1401
  gear   1.0324     0.3206  3.2204   0.0421
  carb  -0.5432     0.1383 -3.9272   0.0244
  
  
  Percentiles of Marginal Effects:
  
            5%     25%     50%     75%     95%
  cyl  -0.3023 -0.0914 -0.0251 -0.0045  0.0251
  disp -0.0101 -0.0065 -0.0036  0.0028  0.0062
  hp   -0.0310 -0.0223 -0.0151 -0.0081  0.0005
  drat -0.5234  0.0534  0.5663  1.3290  3.2306
  wt   -3.1320 -1.8435 -1.2400 -0.7973 -0.1654
  qsec -0.2059  0.1193  0.3080  0.4881  0.9398
  vs*   0.2663  0.9610  1.4825  2.0927  2.6374
  am*  -0.5025  0.7251  1.1666  1.8925  3.0413
  gear -0.4105 -0.1462  1.0044  1.9403  2.9580
  carb -1.1097 -0.6895 -0.5497 -0.3194 -0.0618
  
  (*) Reported average and percentiles of dy/dx is for discrete change of the dummy variable from min to max (usually 0 to 1)).
  
  
  (**) Pseudo-R^2 computed using only the Average Marginal Effects.
  
  
  You may also wish to use predict() for out-of-sample forecasts or shiny.bigKRLS() to interact with results. Type vignette("bigKRLS_basics") for sample syntax. Use save.bigKRLS() to store results and load.bigKRLS() to re-open them.
  
  ..................-- 1. Failure: crossvalidation function works (@test_basic_usage.R#133)  -------
  cv$pseudoR2_oos not equal to cv_noderivs$pseudoR2_oos.
  1/1 mismatches
  [1] 0.85 - 0.919 == -0.0688
  
  ......................
  ....................
  ......................
  ....................
  ................
  .................
  ................
  ................
  ....................
  .....................
  ....................
  ....................
  Overview of Model Performance
  
  N: 250 
  Kfolds: 4 
  Seed: 1234 
  
                          Fold 1 Fold 2 Fold 3 Fold 4
  MSE (In Sample)          0.548  0.791  0.737  0.738
  MSE (Out of Sample)      1.511  0.840  0.861  0.992
  MSE AME (In Sample)      1.685  2.078  2.047  2.812
  MSE AME (Out of Sample)  2.322  1.971  1.904  2.490
  R2 (In Sample)           0.807  0.774  0.798  0.778
  R2 (Out of Sample)       0.690  0.708  0.635  0.709
  R2 AME (In Sample)       0.742  0.726  0.758  0.724
  R2 AME (Out of Sample)   0.728  0.762  0.655  0.775
  
  MSE denotes Mean Squared Error. AME implies calculations done with Average Marginal Effects only.
  
  Summary of Training Model1:
  
  
  MODEL SUMMARY:
  
  lambda: 0.4242 
  N: 187 
  N Effective: 145.6581 
  R2: 0.807 
  R2AME**: 0.7421 
  
  Average Marginal Effects:
  
     Estimate Std. Error t value Pr(>|t|)
  x1   0.8966     0.1903  4.7104        0
  x2   1.7846     0.1891  9.4349        0
  x3   2.2353     0.1893 11.8107        0
  x4   3.1024     0.1867 16.6157        0
  
  
  Percentiles of Marginal Effects:
  
          5%     25%    50%    75%    95%
  x1 -1.8542 -0.0539 1.0144 1.9730 3.8676
  x2 -0.2472  0.9915 1.9094 2.5970 3.6331
  x3 -0.1598  1.2954 2.3651 3.0738 4.9785
  x4  1.0630  2.3291 3.0621 4.0614 4.7020
  
  (**) Pseudo-R^2 computed using only the Average Marginal Effects.
  
  
  You may also wish to use predict() for out-of-sample forecasts or shiny.bigKRLS() to interact with results. Type vignette("bigKRLS_basics") for sample syntax. Use save.bigKRLS() to store results and load.bigKRLS() to re-open them.
  
  
  
  Summary of Training Model2:
  
  
  MODEL SUMMARY:
  
  lambda: 0.6276 
  N: 188 
  N Effective: 152.6068 
  R2: 0.774 
  R2AME**: 0.7263 
  
  Average Marginal Effects:
  
     Estimate Std. Error t value Pr(>|t|)
  x1   0.9558     0.2217  4.3108        0
  x2   1.3343     0.2120  6.2937        0
  x3   2.2734     0.2008 11.3205        0
  x4   3.2660     0.2075 15.7399        0
  
  
  Percentiles of Marginal Effects:
  
          5%    25%    50%    75%    95%
  x1 -1.0700 0.1295 1.0142 1.7457 3.1385
  x2 -1.0014 0.5875 1.4117 2.1568 3.2045
  x3  0.0018 1.4829 2.3793 3.1708 4.3066
  x4  0.4544 2.3957 3.4455 4.2119 5.2587
  
  (**) Pseudo-R^2 computed using only the Average Marginal Effects.
  
  
  You may also wish to use predict() for out-of-sample forecasts or shiny.bigKRLS() to interact with results. Type vignette("bigKRLS_basics") for sample syntax. Use save.bigKRLS() to store results and load.bigKRLS() to re-open them.
  
  
  
  Summary of Training Model3:
  
  
  MODEL SUMMARY:
  
  lambda: 0.6276 
  N: 188 
  N Effective: 152.6536 
  R2: 0.7985 
  R2AME**: 0.7576 
  
  Average Marginal Effects:
  
     Estimate Std. Error t value Pr(>|t|)
  x1   0.9456     0.2099  4.5044        0
  x2   1.5391     0.2095  7.3456        0
  x3   2.3101     0.1914 12.0681        0
  x4   3.0638     0.1979 15.4809        0
  
  
  Percentiles of Marginal Effects:
  
          5%    25%    50%    75%    95%
  x1 -1.3940 0.0174 1.0985 1.8937 3.0292
  x2 -0.7094 0.8357 1.5415 2.3960 3.4850
  x3  0.3179 1.4264 2.3716 3.1394 4.2139
  x4  0.5897 2.2933 3.2291 4.0310 4.9433
  
  (**) Pseudo-R^2 computed using only the Average Marginal Effects.
  
  
  You may also wish to use predict() for out-of-sample forecasts or shiny.bigKRLS() to interact with results. Type vignette("bigKRLS_basics") for sample syntax. Use save.bigKRLS() to store results and load.bigKRLS() to re-open them.
  
  
  
  Summary of Training Model4:
  
  
  MODEL SUMMARY:
  
  lambda: 0.6245 
  N: 187 
  N Effective: 151.9779 
  R2: 0.7779 
  R2AME**: 0.7236 
  
  Average Marginal Effects:
  
     Estimate Std. Error t value Pr(>|t|)
  x1   0.6471     0.2005  3.2274   0.0015
  x2   1.4482     0.1987  7.2866   0.0000
  x3   2.3810     0.2053 11.5976   0.0000
  x4   2.8015     0.1965 14.2571   0.0000
  
  
  Percentiles of Marginal Effects:
  
          5%     25%    50%    75%    95%
  x1 -1.3888 -0.1335 0.8901 1.5267 2.3603
  x2 -0.6060  0.4191 1.5287 2.4598 3.4673
  x3 -0.2051  1.4321 2.4785 3.4337 4.5007
  x4  0.3297  1.8433 2.8435 3.9755 4.7827
  
  (**) Pseudo-R^2 computed using only the Average Marginal Effects.
  
  
  You may also wish to use predict() for out-of-sample forecasts or shiny.bigKRLS() to interact with results. Type vignette("bigKRLS_basics") for sample syntax. Use save.bigKRLS() to store results and load.bigKRLS() to re-open them.
  
  -- 2. Failure: Kfolds crossvalidation works (@test_basic_usage.R#148)  ---------
  kcv$folds not equal to kcvbig$folds.
  185/250 mismatches (average diff: 1.73)
  [1]  2 - 4 == -2
  [2]  4 - 3 ==  1
  [4]  3 - 4 == -1
  [5]  3 - 2 ==  1
  [9]  2 - 3 == -1
  [10] 2 - 3 == -1
  [11] 4 - 2 ==  2
  [13] 2 - 4 == -2
  [15] 4 - 2 ==  2
  ...
  
  -- 3. Failure: Kfolds crossvalidation works (@test_basic_usage.R#149)  ---------
  sum(kcv$fold_1$tested$newdata) not equal to sum(kcvbig$fold_1$tested$newdata[]).
  1/1 mismatches
  [1] 125 - 134 == -9.84
  
  -- 4. Failure: Kfolds crossvalidation works (@test_basic_usage.R#150)  ---------
  sum(kcv$fold_2$tested$predicted) not equal to sum(kcvbig$fold_2$tested$predicted[]).
  1/1 mismatches
  [1] 310 - 297 == 12.5
  
  -- 5. Failure: Kfolds test stats, big vs base (batch 1) (@test_basic_usage.R#157
  kcv$R2_is not equal to kcvbig$R2_is.
  4/4 mismatches (average diff: 0.0167)
  [1] 0.807 - 0.774 ==  0.03331
  [2] 0.774 - 0.790 == -0.01618
  [3] 0.798 - 0.787 ==  0.01145
  [4] 0.778 - 0.772 ==  0.00584
  
  -- 6. Failure: Kfolds test stats, big vs base (batch 1) (@test_basic_usage.R#158
  kcv$R2_oos not equal to kcvbig$R2_oos.
  4/4 mismatches (average diff: 0.0373)
  [1] 0.690 - 0.648 ==  0.0426
  [2] 0.708 - 0.690 ==  0.0177
  [3] 0.635 - 0.667 == -0.0317
  [4] 0.709 - 0.652 ==  0.0571
  
  -- 7. Failure: Kfolds test stats, big vs base (batch 1) (@test_basic_usage.R#159
  kcv$R2AME_is not equal to kcvbig$R2AME_is.
  4/4 mismatches (average diff: 0.014)
  [1] 0.742 - 0.742 ==  0.000381
  [2] 0.726 - 0.731 == -0.004533
  [3] 0.758 - 0.732 ==  0.025218
  [4] 0.724 - 0.750 == -0.026022
  
  -- 8. Failure: Kfolds test stats, big vs base (batch 1) (@test_basic_usage.R#160
  kcv$MSE_is not equal to kcvbig$MSE_is.
  4/4 mismatches (average diff: 0.0694)
  [1] 0.548 - 0.734 == -0.18637
  [2] 0.791 - 0.746 ==  0.04568
  [3] 0.737 - 0.695 ==  0.04123
  [4] 0.738 - 0.733 ==  0.00451
  
  -- 9. Failure: Kfolds test stats, big vs base (batch 2) (@test_basic_usage.R#166
  kcv$MSE_oos not equal to kcvbig$MSE_oos.
  4/4 mismatches (average diff: 0.208)
  [1] 1.511 - 1.276 ==  0.23542
  [2] 0.840 - 0.849 == -0.00938
  [3] 0.861 - 1.195 == -0.33383
  [4] 0.992 - 1.244 == -0.25205
  
  -- 10. Failure: Kfolds test stats, big vs base (batch 2) (@test_basic_usage.R#16
  kcv$MSE_AME_is not equal to kcvbig$MSE_AME_is.
  4/4 mismatches (average diff: 0.402)
  [1] 1.68 - 2.69 == -1.0104
  [2] 2.08 - 2.00 ==  0.0832
  [3] 2.05 - 2.54 == -0.4926
  [4] 2.81 - 2.79 ==  0.0208
  
  -- 11. Failure: Kfolds test stats, big vs base (batch 2) (@test_basic_usage.R#16
  kcv$R2AME_oos not equal to kcvbig$R2AME_oos.
  4/4 mismatches (average diff: 0.0494)
  [1] 0.728 - 0.708 ==  0.0195
  [2] 0.762 - 0.769 == -0.0075
  [3] 0.655 - 0.734 == -0.0795
  [4] 0.775 - 0.685 ==  0.0909
  
  -- 12. Failure: Kfolds test stats, big vs base (batch 2) (@test_basic_usage.R#16
  kcv$MSE_AME_oos not equal to kcvbig$MSE_AME_oos.
  4/4 mismatches (average diff: 0.594)
  [1] 2.32 - 3.18 == -0.8542
  [2] 1.97 - 1.61 ==  0.3649
  [3] 1.90 - 3.05 == -1.1408
  [4] 2.49 - 2.47 ==  0.0171
  
  == testthat results  ===========================================================
  OK: 10 SKIPPED: 0 FAILED: 12
  1. Failure: crossvalidation function works (@test_basic_usage.R#133) 
  2. Failure: Kfolds crossvalidation works (@test_basic_usage.R#148) 
  3. Failure: Kfolds crossvalidation works (@test_basic_usage.R#149) 
  4. Failure: Kfolds crossvalidation works (@test_basic_usage.R#150) 
  5. Failure: Kfolds test stats, big vs base (batch 1) (@test_basic_usage.R#157) 
  6. Failure: Kfolds test stats, big vs base (batch 1) (@test_basic_usage.R#158) 
  7. Failure: Kfolds test stats, big vs base (batch 1) (@test_basic_usage.R#159) 
  8. Failure: Kfolds test stats, big vs base (batch 1) (@test_basic_usage.R#160) 
  9. Failure: Kfolds test stats, big vs base (batch 2) (@test_basic_usage.R#166) 
  1. ...
  
  Error: testthat unit tests failed
  Execution halted