Running ‘testthat.R’ [85s/97s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > Sys.setenv("R_TESTS" = "")
  > 
  > library(testthat)
  > library(rmdcev)
  Loading required package: Rcpp
  > test_check("rmdcev")
  
  SAMPLING FOR MODEL 'mdcev' NOW (CHAIN 1).
  Chain 1: 
  Chain 1: Gradient evaluation took 0.05 seconds
  Chain 1: 1000 transitions using 10 leapfrog steps per transition would take 500 seconds.
  Chain 1: Adjust your expectations accordingly!
  Chain 1: 
  Chain 1: 
  Chain 1: WARNING: No variance estimation is
  Chain 1:          performed for num_warmup < 20
  Chain 1: 
  Chain 1: Iteration: 1 / 10 [ 10%]  (Warmup)
  Chain 1: Iteration: 2 / 10 [ 20%]  (Warmup)
  Chain 1: Iteration: 3 / 10 [ 30%]  (Warmup)
  Chain 1: Iteration: 4 / 10 [ 40%]  (Warmup)
  Chain 1: Iteration: 5 / 10 [ 50%]  (Warmup)
  Chain 1: Iteration: 6 / 10 [ 60%]  (Sampling)
  Chain 1: Iteration: 7 / 10 [ 70%]  (Sampling)
  Chain 1: Iteration: 8 / 10 [ 80%]  (Sampling)
  Chain 1: Iteration: 9 / 10 [ 90%]  (Sampling)
  Chain 1: Iteration: 10 / 10 [100%]  (Sampling)
  Chain 1: 
  Chain 1:  Elapsed Time: 0.77 seconds (Warm-up)
  Chain 1:                0.31 seconds (Sampling)
  Chain 1:                1.08 seconds (Total)
  Chain 1: 
  Model run using rmdcev for R, version 0.9.0 
  Estimation method                : Bayes
  Model type                       : hybrid0 specification
  Number of classes                : 1
  Number of individuals            : 499
  Number of non-numeraire alts     : 17
  Estimated parameters             : 35
  LL                               : -14668.54
  Number of chains                 : 1
  Number of warmup draws per chain : 5
  Total post-warmup sample         : 5
  Time taken (hh:mm:ss)            : 00:00:2.91
  
  Average consumption of non-numeraire alternatives:
      1     2     3     4     5     6     7     8     9    10    11    12    13 
   6.48 12.29  2.34  9.05  3.85 22.02  4.45 39.60  0.64  1.14  0.84  0.27  4.49 
     14    15    16    17 
   3.04  9.22  2.37  1.49 
  
  
  Psi specification:
  ~
  factor(good_name) - 1
  Parameter estimates --------------------------------  
                                      Estimate Std.err z.stat n_eff Rhat
  psi_factor(good_name)beach             1.002       0    Inf    NA   NA
  psi_factor(good_name)birding           0.104       0    Inf    NA   NA
  psi_factor(good_name)camping          -0.365       0   -Inf    NA   NA
  psi_factor(good_name)cycling           0.619       0    Inf    NA   NA
  psi_factor(good_name)fish             -0.606       0   -Inf    NA   NA
  psi_factor(good_name)garden            0.950       0    Inf    NA   NA
  psi_factor(good_name)golf              0.300       0    Inf    NA   NA
  psi_factor(good_name)hiking            2.249       0    Inf    NA   NA
  psi_factor(good_name)hunt_birds       -1.000       0   -Inf    NA   NA
  psi_factor(good_name)hunt_large        0.139       0    Inf    NA   NA
  psi_factor(good_name)hunt_trap         0.179       0    Inf    NA   NA
  psi_factor(good_name)hunt_waterfowl   -1.834       0   -Inf    NA   NA
  psi_factor(good_name)motor_land       -1.519       0   -Inf    NA   NA
  psi_factor(good_name)motor_water       0.082       0    Inf    NA   NA
  psi_factor(good_name)photo            -0.554       0   -Inf    NA   NA
  psi_factor(good_name)ski_cross        -0.302       0   -Inf    NA   NA
  psi_factor(good_name)ski_down         -0.129       0   -Inf    NA   NA
  gamma1                                 0.679       0    Inf    NA   NA
  gamma2                                 1.184       0    Inf    NA   NA
  gamma3                                 1.471       0    Inf    NA   NA
  gamma4                                 1.450       0    Inf    NA   NA
  gamma5                                 2.947       0    Inf    NA   NA
  gamma6                                 2.959       0    Inf    NA   NA
  gamma7                                 2.428       0    Inf    NA   NA
  gamma8                                 1.800       0    Inf    NA   NA
  gamma9                                 0.505       0    Inf    NA   NA
  gamma10                                0.539       0    Inf    NA   NA
  gamma11                                0.302       0    Inf    NA   NA
  gamma12                                0.457       0    Inf    NA   NA
  gamma13                                0.754       0    Inf    NA   NA
  gamma14                                1.176       0    Inf    NA   NA
  gamma15                                1.978       0    Inf    NA   NA
  gamma16                                2.990       0    Inf    NA   NA
  gamma17                                2.097       0    Inf    NA   NA
  scale                                  2.562       0    Inf    NA   NA
  Note: All alpha parameters fixed to 1e-3. 
  Note: For each parameter, n_eff is a crude measure of effective sample size, and Rhat is the potential scale reduction factor on split chains (at convergence, Rhat=1) 
  
  Model run using rmdcev for R, version 0.9.0 
  Estimation method                : MLE
  Model type                       : hybrid0 specification
  Number of classes                : 1
  Number of individuals            : 99
  Number of non-numeraire alts     : 17
  Estimated parameters             : 19
  LL                               : -2684.77
  AIC                              : 5407.53
  BIC                              : 5456.84
  Standard errors calculated using : Delta method
  Exit of MLE                      : successful convergence
  Time taken (hh:mm:ss)            : 00:00:0.57
  
  Average consumption of non-numeraire alternatives:
      1     2     3     4     5     6     7     8     9    10    11    12    13 
   6.86 14.03  2.70  9.34  4.85 25.62  6.92 38.30  0.53  1.30  0.61  0.37  3.02 
     14    15    16    17 
   3.05 10.67  1.55  2.17 
  
  
  Psi specification:
  ~
  1
  Parameter estimates --------------------------------  
                  Estimate Std.err z.stat
  psi_(Intercept)   -7.625   0.110 -69.32
  gamma1             6.576   1.578   4.17
  gamma2            12.290   4.026   3.05
  gamma3             4.545   1.249   3.64
  gamma4            11.048   2.948   3.75
  gamma5            10.183   2.899   3.51
  gamma6            15.262   3.176   4.81
  gamma7            12.221   3.854   3.17
  gamma8            18.507   3.622   5.11
  gamma9             4.621   2.715   1.70
  gamma10            9.236   3.645   2.53
  gamma11            5.104   3.066   1.66
  gamma12            6.284   4.969   1.26
  gamma13           12.375   4.639   2.67
  gamma14            9.683   3.545   2.73
  gamma15           12.668   3.597   3.52
  gamma16            2.371   0.790   3.00
  gamma17            8.116   3.249   2.50
  scale              0.859   0.040  21.47
  Note: All alpha parameters fixed to 1e-3. 
  
  [1] -2684.766939
  Model run using rmdcev for R, version 0.9.0 
  Estimation method                : MLE
  Model type                       : hybrid specification
  Number of classes                : 1
  Number of individuals            : 99
  Number of non-numeraire alts     : 17
  Estimated parameters             : 20
  LL                               : -2684.76
  AIC                              : 5409.52
  BIC                              : 5461.42
  Standard errors calculated using : Delta method
  Exit of MLE                      : successful convergence
  Time taken (hh:mm:ss)            : 00:00:1.09
  
  Average consumption of non-numeraire alternatives:
      1     2     3     4     5     6     7     8     9    10    11    12    13 
   6.86 14.03  2.70  9.34  4.85 25.62  6.92 38.30  0.53  1.30  0.61  0.37  3.02 
     14    15    16    17 
   3.05 10.67  1.55  2.17 
  
  
  Psi specification:
  ~
  1
  Parameter estimates --------------------------------  
                  Estimate Std.err z.stat
  psi_(Intercept)   -7.636   0.112 -68.17
  gamma1             6.581   1.579   4.17
  gamma2            12.295   4.028   3.05
  gamma3             4.550   1.250   3.64
  gamma4            11.058   2.951   3.75
  gamma5            10.192   2.901   3.51
  gamma6            15.281   3.180   4.81
  gamma7            12.224   3.854   3.17
  gamma8            18.538   3.627   5.11
  gamma9             4.634   2.723   1.70
  gamma10            9.246   3.648   2.53
  gamma11            5.111   3.070   1.66
  gamma12            6.266   4.953   1.27
  gamma13           12.395   4.646   2.67
  gamma14            9.693   3.548   2.73
  gamma15           12.681   3.601   3.52
  gamma16            2.371   0.789   3.00
  gamma17            8.129   3.253   2.50
  alpha1             0.000  15.203   0.00
  scale              0.859   0.040  21.48
  Note: Alpha parameter is equal for all goods. 
  
  Model run using rmdcev for R, version 0.9.0 
  Estimation method                : MLE
  Model type                       : hybrid0 specification
  Number of classes                : 2
  Number of individuals            : 499
  Number of non-numeraire alts     : 17
  Estimated parameters             : 41
  LL                               : -12612.59
  AIC                              : 25307.19
  BIC                              : 25479.91
  Standard errors calculated using : Delta method
  Exit of MLE                      : successful convergence
  Time taken (hh:mm:ss)            : 00:00:16.2
  
  Average consumption of non-numeraire alternatives:
      1     2     3     4     5     6     7     8     9    10    11    12    13 
   6.48 12.29  2.34  9.05  3.85 22.02  4.45 39.60  0.64  1.14  0.84  0.27  4.49 
     14    15    16    17 
   3.04  9.22  2.37  1.49 
  
  
  Psi specification:
  ~
  1
  
  Membership equation:
  ~
  university + ageindex
  
  Class average probabilities:
  class1 class2 
    0.71   0.29 
  Parameter estimates --------------------------------  
                         Estimate Std.err  z.stat
  class1.psi_(Intercept)   -7.835   0.053 -147.84
  class2.psi_(Intercept)   -7.483   0.136  -55.02
  class1.gamma1            11.330   1.754    6.46
  class2.gamma1             3.847   0.861    4.47
  class1.gamma2            29.500   5.695    5.18
  class2.gamma2             1.932   0.365    5.29
  class1.gamma3             6.482   1.185    5.47
  class2.gamma3             2.981   0.400    7.45
  class1.gamma4            21.952   5.046    4.35
  class2.gamma4             4.840   0.622    7.78
  class1.gamma5            12.793   3.997    3.20
  class2.gamma5             4.542   1.216    3.74
  class1.gamma6            30.409  12.067    2.52
  class2.gamma6             3.623   1.940    1.87
  class1.gamma7            15.950   3.501    4.56
  class2.gamma7             4.538   1.061    4.28
  class1.gamma8            34.142   5.892    5.79
  class2.gamma8             6.379   1.275    5.00
  class1.gamma9             7.109   2.182    3.26
  class2.gamma9             1.988   0.421    4.72
  class1.gamma10           12.275   3.851    3.19
  class2.gamma10            5.843   1.303    4.48
  class1.gamma11            4.998   1.322    3.78
  class2.gamma11            5.675   1.528    3.71
  class1.gamma12            7.733   2.143    3.61
  class2.gamma12            2.996   0.924    3.24
  class1.gamma13           19.362   4.041    4.79
  class2.gamma13            4.541   1.994    2.28
  class1.gamma14           13.099   4.696    2.79
  class2.gamma14            3.497   2.024    1.73
  class1.gamma15           16.164   8.317    1.94
  class2.gamma15            4.972   1.510    3.29
  class1.gamma16            6.475   1.656    3.91
  class2.gamma16            1.810   0.453    4.00
  class1.gamma17            7.824   2.285    3.42
  class2.gamma17            3.881   1.033    3.76
  class1.scale              0.683   0.029   23.56
  class2.scale              1.039   0.053   19.61
  class2.(Intercept)        1.593   0.545    2.92
  class2.university         0.432   0.395    1.09
  class2.ageindex          -2.976   0.616   -4.83
  Note: All alpha parameters fixed to 1e-3. 
  Note: The membership equation parameters for class 1 are normalized to 0. 
  
  [1] -12612.59445
  "/home/ripley/R/Lib32/rstan/include/exporter.h", line 69: Warning: "typename" must be used within a template.
  "/tmp/RtmpFuayXK/RLIBS_498bff43f0/RcppEigen/include/Eigen/src/SparseCore/SparseCwiseUnaryOp.h", line 49: Error: Cannot define member of undefined specialization "unary_evaluator<CwiseUnaryOp<UnaryOp, ArgType>, Eigen::internal::IteratorBased>".
  "/tmp/RtmpFuayXK/RLIBS_498bff43f0/RcppEigen/include/Eigen/src/SparseCore/SparseCwiseUnaryOp.h", line 99: Error: Cannot define member of undefined specialization "unary_evaluator<CwiseUnaryView<ViewOp, ArgType>, Eigen::internal::IteratorBased>".
  "/tmp/RtmpFuayXK/RLIBS_498bff43f0/RcppEigen/include/Eigen/src/SparseCore/SparseBlock.h", line 503: Error: Cannot define member of undefined specialization "unary_evaluator<Block<ArgType, BlockRows, BlockCols, InnerPanel>, Eigen::internal::IteratorBased>".
  "/tmp/RtmpFuayXK/RLIBS_498bff43f0/RcppEigen/include/Eigen/src/SparseCore/SparseBlock.h", line 529: Error: Cannot define member of undefined specialization "unary_evaluator<Block<ArgType, BlockRows, BlockCols, InnerPanel>, Eigen::internal::IteratorBased>".
  "/home/ripley/R/Lib32/StanHeaders/include/stan/math/prim/mat/fun/matrix_exp_action_handler.hpp", line 67: Warning:  The template qualifier can only be used within a template.
  "/home/ripley/R/Lib32/StanHeaders/include/stan/math/prim/mat/fun/matrix_exp_action_handler.hpp", line 71: Warning:  The template qualifier can only be used within a template.
  "/home/ripley/R/Lib32/StanHeaders/include/stan/math/prim/mat/fun/matrix_exp_action_handler.hpp", line 73: Warning:  The template qualifier can only be used within a template.
  4 Error(s) and 4 Warning(s) detected.
  make: Fatal error: Command failed for target `file21d7622d1dbf.o'
  Current working directory /tmp/RtmpDua46q/sourceCpp-i386-pc-solaris2.10-1.0.2/sourcecpp_21d71a7b3e28
  ── 1. Error: (unknown) (@test-simulations.R#25)  ───────────────────────────────
  Error 1 occurred building shared library.
  1: expose_stan_functions(stanmodels$SimulationFunctions) at testthat/test-simulations.R:25
  2: pkgbuild::with_build_tools(suppressWarnings(Rcpp::sourceCpp(code = paste(code, collapse = "\n"), 
         ...)), required = rstan_options("required") && identical(Sys.getenv("WINDOWS"), 
         "TRUE") && !identical(Sys.getenv("R_PACKAGE_SOURCE"), ""))
  3: suppressWarnings(Rcpp::sourceCpp(code = paste(code, collapse = "\n"), ...))
  4: withCallingHandlers(expr, warning = function(w) invokeRestart("muffleWarning"))
  5: Rcpp::sourceCpp(code = paste(code, collapse = "\n"), ...)
  6: stop("Error ", status, " occurred building shared library.")
  
  ── 2. Error: (unknown) (@test-simulations.R#25)  ───────────────────────────────
  invalid connection
  1: expose_stan_functions(stanmodels$SimulationFunctions) at testthat/test-simulations.R:25
  2: sink(type = "output") at testthat/test-simulations.R:25
  
  ══ testthat results  ═══════════════════════════════════════════════════════════
  [ OK: 23 | SKIPPED: 0 | WARNINGS: 1 | FAILED: 2 ]
  1. Error: (unknown) (@test-simulations.R#25) 
  2. Error: (unknown) (@test-simulations.R#25) 
  
  Error: testthat unit tests failed
  Execution halted