Running ‘testthat.R’ [15m/19m]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > # Had the same issue as in this thread: https://github.com/hadley/testthat/issues/86
  > Sys.setenv("R_TESTS" = "")
  > 
  > library(testthat)
  > library(biglm)
  Loading required package: DBI
  > library(dynamichazard)
  Loading required package: survival
  > 
  > is_build_win = T
  > if(is_build_win)
  +   options(ddhazard_max_threads = 2)
  > 
  > cat("Running tests on:\n")
  Running tests on:
  > print(R.version)
                 _                                     
  platform       i386-pc-solaris2.10                   
  arch           i386                                  
  os             solaris2.10                           
  system         i386, solaris2.10                     
  status         RC                                    
  major          3                                     
  minor          4.1                                   
  year           2017                                  
  month          06                                    
  day            22                                    
  svn rev        72852                                 
  language       R                                     
  version.string R version 3.4.1 RC (2017-06-22 r72852)
  nickname       Single Candle                         
  > options(warn=1)
  > 
  > 
  > test_check("dynamichazard")
  
  Running IWLS 
  
  Finished IWLS 
  
  Running UKF 
  1. Failure: UKF on head_neck works with logit model (@testUKF.R#64) ------------
  `result` not equal to read_to_test("UKF1").
  Component "state_vecs": Mean absolute difference: Inf
  Component "state_vars": 'is.NA' value mismatch: 0 in current 6 in target
  
  
  2. Error: UKF does not fail and both methods give the same (@testUKF.R#85) -----
  Failed to estimate model. The following learning rates was tried: 1, 0.9, 0.81, 0.729, 0.6561, 0.59049, 0.531441, 0.4782969, 0.43046721, 0.387420489. Try decreasing the learning rate or change denom_term
  1: ddhazard(formula = survival::Surv(tstart, tstop, event) ~ . - tstart - tstop - event - 
         id, by = 1, data = sims$res, a_0 = rep(0, ncol(sims$res) + 1 - 4), Q_0 = diag(rep(1, 
         ncol(sims$res) + 1 - 4)), control = list(est_Q_0 = F, kappa = 0.1, alpha = 1, 
         beta = 0, eps = 0.01, method = "UKF_org"), id = sims$res$id, max_T = 10) at testthat/testUKF.R:85
  2: stop("Failed to estimate model. The following learning rates was tried: ", paste0(control$LR * 
         control$LR_decrease_fac^k_vals, collapse = ", "), ". Try decreasing the learning rate or change denom_term")
  
  3. Failure: Chaning time scale in UKF does no change results when other parems are changed accoridngly (@testUKF.R#124) 
  res$state_vecs not equal to res_new_time$state_vecs.
  44/44 mismatches (average diff: 4.22)
  [1] -9.41 - -2.68 == -6.73
  [2] -9.41 - -2.68 == -6.73
  [3] -9.41 - -2.68 == -6.73
  [4] -9.41 - -2.68 == -6.73
  [5] -9.41 - -2.68 == -6.73
  [6] -9.41 - -2.68 == -6.73
  [7] -9.41 - -2.68 == -6.73
  [8] -9.41 - -2.68 == -6.73
  [9] -9.41 - -2.68 == -6.73
  ...
  
  
  4. Failure: Chaning time scale in UKF does no change results when other parems are changed accoridngly (@testUKF.R#125) 
  res$state_vars not equal to res_new_time$state_vars.
  176/176 mismatches (average diff: 0.25)
  [1]  1.00e+00 -  2.88e-06 ==  1.00e+00
  [2]  6.57e-08 - -2.16e-06 ==  2.22e-06
  [3]  1.45e-07 - -2.76e-07 ==  4.21e-07
  [4]  6.22e-08 - -3.10e-07 ==  3.72e-07
  [5]  6.57e-08 - -2.16e-06 ==  2.22e-06
  [6]  1.00e+00 -  2.25e-04 ==  1.00e+00
  [7] -1.89e-08 -  7.34e-05 == -7.34e-05
  [8] -8.43e-09 - -9.88e-06 ==  9.88e-06
  [9]  1.45e-07 - -2.76e-07 ==  4.21e-07
  ...
  
  
  5. Failure: Chaning time scale in UKF does no change results when other parems are changed accoridngly (@testUKF.R#126) 
  res$Q not equal to res_new_time$Q * t_mult.
  14/16 mismatches (average diff: 3.54e-07)
  [1]   2.97e-06 -  1.71e-07 ==  2.80e-06
  [2]  -1.83e-07 - -1.13e-08 == -1.71e-07
  [3]   2.92e-07 -  1.91e-08 ==  2.72e-07
  [4]   2.47e-08 - -2.26e-08 ==  4.74e-08
  [5]  -1.83e-07 - -1.13e-08 == -1.71e-07
  [6]   3.57e-07 -  5.41e-08 ==  3.03e-07
  [7]  -2.16e-07 - -1.01e-08 == -2.06e-07
  [9]   2.92e-07 -  1.91e-08 ==  2.72e-07
  [10] -2.16e-07 - -1.01e-08 == -2.06e-07
  ...
  
  
  6. Failure: Testing UKF against prev computed values (@testUKF.R#150) ----------
  `res` not equal to read_to_test("UKF2").
  Component "state_vars": Mean relative difference: 86616.54
  Component "Q": Mean relative difference: 1036879
  
  
  7. Failure: UKF on simulated data works with exponential models with only one of the variables (@testUKF.R#216) 
  `result_exp` not equal to read_to_test("UKF4").
  Component "state_vars": Mean relative difference: 155.951
  Component "state_vecs": Mean relative difference: 0.9972669
  Component "Q": Mean absolute difference: 0.3385309
  
  
  8. Failure: UKF on simulated data works with exponential models with only one of the variables (@testUKF.R#236) 
  `result_exp` not equal to read_to_test("UKF5").
  Component "state_vars": Mean relative difference: 2.88823
  Component "state_vecs": Mean relative difference: 0.9178451
  Component "Q": Mean relative difference: 6983396
  
  
  9. Failure: UKF on simulated data works with exponential models with only one of the variables (@testUKF.R#256) 
  `result_exp` not equal to read_to_test("UKF6").
  Component "state_vars": Mean relative difference: 1.1247
  Component "state_vecs": Mean relative difference: 0.8464919
  Component "Q": Mean relative difference: 3297.771
  
  
  10. Failure: UKF and exp models give previous computed results for head_neck (@testUKF.R#319) 
  `result_exp` not equal to read_to_test("UKF_exp_head_neck").
  Component "state_vecs": Mean relative difference: 0.9954457
  Component "state_vars": Mean relative difference: 0.9999915
  Component "Q": Mean relative difference: 0.9999987
  
  
  
  Finished UKF 
  
  Running test_GMA 
  
  Finished test_GMA 
  
  Running Testing LAPACK wrapper functions 
  
  Finished Testing LAPACK wrapper functions 
  
  Running test_SMA 
  
  Finished test_SMA 
  
  Running hatvalues 
  
  Finished hatvalues 
  
  Running shiny app 
  
  Finished shiny app 
  
  Running bigglm_wrapper 
  
  Finished bigglm_wrapper 
  
  Running boot 
  
  Finished boot 
  
  Running ddhazard 
  
  Finished ddhazard 
  
  Running design_mat_... 
  11. Error: Different forms of fixing the intercept gives same results (@testdesign_mat_and_risk_obj.R#63) 
  State vector in correction step has nan or inf elements in in bin 1. Try decreasing the learning rate
  1: suppressWarnings(suppressMessages(ddhazard(survival::Surv(tstart, tstop, event) ~ 
         ddFixed(1) + x1 + x2, model = m, by = 1, data = sims, max_T = 10, Q_0 = diag(1, 
         2), Q = diag(0.01, 2), control = list(eps = 0.1, method = "GMA", fixed_terms_method = "M_step")))) at testthat/testdesign_mat_and_risk_obj.R:63
  2: withCallingHandlers(expr, warning = function(w) invokeRestart("muffleWarning"))
  3: suppressMessages(ddhazard(survival::Surv(tstart, tstop, event) ~ ddFixed(1) + x1 + 
         x2, model = m, by = 1, data = sims, max_T = 10, Q_0 = diag(1, 2), Q = diag(0.01, 
         2), control = list(eps = 0.1, method = "GMA", fixed_terms_method = "M_step")))
  4: withCallingHandlers(expr, message = function(c) invokeRestart("muffleMessage"))
  5: ddhazard(survival::Surv(tstart, tstop, event) ~ ddFixed(1) + x1 + x2, model = m, 
         by = 1, data = sims, max_T = 10, Q_0 = diag(1, 2), Q = diag(0.01, 2), control = list(eps = 0.1, 
             method = "GMA", fixed_terms_method = "M_step"))
  6: tryCatch({
         result <- ddhazard_no_validation(a_0 = a_0, Q_0 = Q_0, F_ = F_, verbose = verbose, 
             Q = Q, risk_set = risk_set, X_Y = X_Y, order = order, model = model, LR = control$LR * 
                 control$LR_decrease_fac^(k), n_fixed_terms_in_state_vec = ifelse(est_fixed_in_E, 
                 n_fixed, 0), weights = weights, control)
     }, error = function(e) if (length(k_vals) == 1 || !grepl("^ddhazard_fit_cpp estimation error:", 
         e$message)) stop(e))
  7: tryCatchList(expr, classes, parentenv, handlers)
  8: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  9: value[[3L]](cond)
  
  
  Finished design_mat_... 
  
  Running fixed_effects_like_recursive_least_squares 
  12. Failure: Works with UKF and logit model (@testfixed_effects_like_recursive_least_squares.R#86) 
  `fit` not equal to read_to_test("E_step_sim_UKF").
  Component "state_vars": Mean relative difference: 0.8767869
  Component "state_vecs": Mean relative difference: 1.019852
  Component "Q": Mean relative difference: 478579.1
  
  
  13. Failure: Works with UKF and continous time model (@testfixed_effects_like_recursive_least_squares.R#147) 
  `fit` not equal to read_to_test("E_step_sim_exp_UKF").
  Component "state_vars": Mean relative difference: 0.9830224
  Component "state_vecs": Mean relative difference: 0.6504735
  Component "Q": Mean relative difference: 1.256004
  
  
  14. Failure: Works with second order random walk and continous time model (@testfixed_effects_like_recursive_least_squares.R#168) 
  `fit` not equal to read_to_test("E_step_sim_exp_UKF_order_two").
  Component "state_vars": Mean relative difference: 1.727035
  Component "state_vecs": Mean relative difference: 0.8949309
  Component "Q": Mean relative difference: 0.8565446
  
  
  
  Finished fixed_effects_like_recursive_least_squares 
  
  Running testfixed_terms_est_in_M_step 
  15. Failure: UKF with fixed effects works (@testfixed_terms_est_in_M_step.R#148) 
  `fit` not equal to read_to_test("fixed_terms_UKF").
  Component "state_vars": Mean absolute difference: 0.1798319
  Component "state_vecs": Mean relative difference: 0.9971247
  Component "fixed_effects": Mean relative difference: 1
  
  
  16. Failure: UKF with fixed effects works (@testfixed_terms_est_in_M_step.R#164) 
  `fit` not equal to read_to_test("fixed_terms_UKF_exp").
  Component "state_vars": Mean absolute difference: 0.2873126
  Component "state_vecs": Mean relative difference: 0.8541628
  Component "fixed_effects": Mean relative difference: 0.1668254
  
  
  
  Finished testfixed_terms_est_in_M_step 
  
  Running loglike 
  
  Finished loglike 
  
  Running options 
  
  Finished options 
  
  Running plot 
  
  Finished plot 
  
  Running predict 
  
  Finished predict 
  
  Running print 
  
  Finished print 
  
  Running residuals 
  Warning in ddhazard_fit_cpp(a_0 = a_0, Q_0 = Q_0, F_ = F_, verbose = verbose,  :
    Q - Q.t() maximal element difference was 3.12085e-08 in iteration 30
  Warning in ddhazard_fit_cpp(a_0 = a_0, Q_0 = Q_0, F_ = F_, verbose = verbose,  :
    Q - Q.t() maximal element difference was 1.52746e-07 in iteration 31
  Warning in ddhazard_fit_cpp(a_0 = a_0, Q_0 = Q_0, F_ = F_, verbose = verbose,  :
    Q - Q.t() maximal element difference was 5.2603e-07 in iteration 33
  Warning in ddhazard_fit_cpp(a_0 = a_0, Q_0 = Q_0, F_ = F_, verbose = verbose,  :
    Q - Q.t() maximal element difference was 3.41633e-07 in iteration 34
  Warning in ddhazard_fit_cpp(a_0 = a_0, Q_0 = Q_0, F_ = F_, verbose = verbose,  :
    Q - Q.t() maximal element difference was 8.6613e-08 in iteration 60
  Warning in ddhazard_fit_cpp(a_0 = a_0, Q_0 = Q_0, F_ = F_, verbose = verbose,  :
    Q - Q.t() maximal element difference was 6.00074e-06 in iteration 62
  Warning in ddhazard_fit_cpp(a_0 = a_0, Q_0 = Q_0, F_ = F_, verbose = verbose,  :
    Q - Q.t() maximal element difference was 1.45313e-06 in iteration 63
  Warning in ddhazard_fit_cpp(a_0 = a_0, Q_0 = Q_0, F_ = F_, verbose = verbose,  :
    Q - Q.t() maximal element difference was 2.80689e-06 in iteration 64
  Warning in ddhazard_fit_cpp(a_0 = a_0, Q_0 = Q_0, F_ = F_, verbose = verbose,  :
    Q - Q.t() maximal element difference was 9.33258e-07 in iteration 65
  Warning in ddhazard_fit_cpp(a_0 = a_0, Q_0 = Q_0, F_ = F_, verbose = verbose,  :
    Q - Q.t() maximal element difference was 2.3614e-06 in iteration 80
  Warning in ddhazard_fit_cpp(a_0 = a_0, Q_0 = Q_0, F_ = F_, verbose = verbose,  :
    Q - Q.t() maximal element difference was 1.21247e-06 in iteration 82
  Warning in ddhazard_fit_cpp(a_0 = a_0, Q_0 = Q_0, F_ = F_, verbose = verbose,  :
    Q - Q.t() maximal element difference was 5.96454e-07 in iteration 85
  Warning in ddhazard_fit_cpp(a_0 = a_0, Q_0 = Q_0, F_ = F_, verbose = verbose,  :
    Q - Q.t() maximal element difference was 3.57482e-07 in iteration 87
  Warning in ddhazard_fit_cpp(a_0 = a_0, Q_0 = Q_0, F_ = F_, verbose = verbose,  :
    Q - Q.t() maximal element difference was 2.12019e-05 in iteration 100
  Warning in ddhazard_fit_cpp(a_0 = a_0, Q_0 = Q_0, F_ = F_, verbose = verbose,  :
    EM algorithm did not converge within the n_max number of iterations
  
  Finished residuals 
  
  Running static_glm 
  
  Finished static_glm 
  
  Running test_utils 
  
  Finished test_utils 
  
  Running weights 
  17. Failure: Making large design mat and using weights yield the same with UKF (@testweights.R#110) 
  f1$state_vecs not equal to f2$state_vecs.
  12/12 mismatches (average diff: 8.57)
  [1]  -8.639 - -1.142 ==  -7.496
  [2] -18.685 - -1.142 == -17.543
  [3] -14.905 - -1.108 == -13.797
  [4] -14.771 - -1.226 == -13.546
  [5] -13.727 - -1.232 == -12.495
  [6] -14.606 - -1.272 == -13.335
  [7]   0.212 -  0.339 ==  -0.127
  [8]  -7.076 -  0.339 ==  -7.415
  [9]  -4.301 -  0.387 ==  -4.688
  ...
  m = logit
  
  18. Failure: Making large design mat and using weights yield the same with UKF (@testweights.R#111) 
  f1$state_vars not equal to f2$state_vars.
  24/24 mismatches (average diff: 29.4)
  [1]  0.800 -  0.1016 ==  0.698
  [2]  0.265 - -0.0474 ==  0.313
  [3]  0.265 - -0.0474 ==  0.313
  [4]  0.637 -  0.1338 ==  0.503
  [5] 32.433 -  0.0666 == 32.366
  [6] 23.830 - -0.0523 == 23.882
  [7] 23.830 - -0.0523 == 23.882
  [8] 18.162 -  0.0953 == 18.066
  [9] 42.247 -  0.0586 == 42.188
  ...
  m = logit
  
  19. Failure: Making large design mat and using weights yield the same with UKF (@testweights.R#110) 
  f1$state_vecs not equal to f2$state_vecs.
  12/12 mismatches (average diff: 17.7)
  [1] -25.9 - -3.006 == -22.9
  [2] -25.9 - -3.006 == -22.9
  [3] -25.9 - -2.844 == -23.1
  [4] -25.9 - -2.978 == -23.0
  [5] -25.9 - -2.975 == -23.0
  [6] -25.9 - -3.024 == -22.9
  [7] -12.4 -  0.126 == -12.5
  [8] -12.4 -  0.127 == -12.5
  [9] -12.4 -  0.309 == -12.7
  ...
  m = exp_bin
  
  20. Failure: Making large design mat and using weights yield the same with UKF (@testweights.R#111) 
  f1$state_vars not equal to f2$state_vars.
  24/24 mismatches (average diff: 0.937)
  [1] 1.00e+00 -  0.1070 == 0.8930
  [2] 2.98e-17 - -0.0388 == 0.0388
  [3] 2.98e-17 - -0.0388 == 0.0388
  [4] 1.00e+00 -  0.1351 == 0.8649
  [5] 1.33e+00 -  0.0684 == 1.2634
  [6] 1.43e-01 - -0.0481 == 0.1909
  [7] 1.43e-01 - -0.0481 == 0.1909
  [8] 1.12e+00 -  0.0916 == 1.0303
  [9] 1.66e+00 -  0.0578 == 1.6058
  ...
  m = exp_bin
  
  21. Failure: Making large design mat and using weights yield the same with UKF (@testweights.R#110) 
  f1$state_vecs not equal to f2$state_vecs.
  12/12 mismatches (average diff: 10.3)
  [1] -18.6 - -3.707 == -14.91
  [2] -18.6 - -3.769 == -14.84
  [3] -18.6 - -2.530 == -16.08
  [4] -18.6 - -3.388 == -15.22
  [5] -18.6 - -3.636 == -14.97
  [6] -18.6 - -3.761 == -14.85
  [7]  -5.9 - -0.569 ==  -5.33
  [8]  -5.9 - -0.628 ==  -5.27
  [9]  -5.9 -  0.496 ==  -6.40
  ...
  m = exp_clip_time
  
  22. Failure: Making large design mat and using weights yield the same with UKF (@testweights.R#111) 
  f1$state_vars not equal to f2$state_vars.
  24/24 mismatches (average diff: 0.563)
  [1]  1.00e+00 - 0.4321 ==  0.5679
  [2] -1.56e-14 - 0.2154 == -0.2154
  [3] -1.56e-14 - 0.2154 == -0.2154
  [4]  1.00e+00 - 0.4205 ==  0.5795
  [5]  1.19e+00 - 0.2464 ==  0.9416
  [6]  4.90e-02 - 0.0805 == -0.0316
  [7]  4.90e-02 - 0.0805 == -0.0316
  [8]  1.07e+00 - 0.2763 ==  0.7909
  [9]  1.38e+00 - 0.2516 ==  1.1245
  ...
  m = exp_clip_time
  
  23. Failure: Making large design mat and using weights yield the same with UKF (@testweights.R#110) 
  f1$state_vecs not equal to f2$state_vecs.
  12/12 mismatches (average diff: 17.4)
  [1] -28.24 - -3.1254 == -25.11
  [2] -28.24 - -3.1264 == -25.11
  [3] -28.24 - -2.9107 == -25.33
  [4] -28.24 - -3.0861 == -25.15
  [5] -28.24 - -3.0749 == -25.17
  [6] -28.24 - -3.1118 == -25.13
  [7]  -9.67 -  0.0418 ==  -9.71
  [8]  -9.67 -  0.0421 ==  -9.71
  [9]  -9.67 -  0.2492 ==  -9.92
  ...
  m = exp_clip_time_w_jump
  
  24. Failure: Making large design mat and using weights yield the same with UKF (@testweights.R#111) 
  f1$state_vars not equal to f2$state_vars.
  24/24 mismatches (average diff: 0.951)
  [1]  1.00e+00 -  0.1164 == 0.8836
  [2] -5.53e-18 - -0.0363 == 0.0363
  [3] -5.53e-18 - -0.0363 == 0.0363
  [4]  1.00e+00 -  0.1436 == 0.8564
  [5]  1.42e+00 -  0.0736 == 1.3510
  [6]  1.26e-01 - -0.0484 == 0.1743
  [7]  1.26e-01 - -0.0484 == 0.1743
  [8]  1.09e+00 -  0.0986 == 0.9920
  [9]  1.85e+00 -  0.0611 == 1.7881
  ...
  m = exp_clip_time_w_jump
  
  
  Finished weights 
  testthat results ================================================================
  OK: 6672 SKIPPED: 0 FAILED: 24
  1. Failure: UKF on head_neck works with logit model (@testUKF.R#64) 
  2. Error: UKF does not fail and both methods give the same (@testUKF.R#85) 
  3. Failure: Chaning time scale in UKF does no change results when other parems are changed accoridngly (@testUKF.R#124) 
  4. Failure: Chaning time scale in UKF does no change results when other parems are changed accoridngly (@testUKF.R#125) 
  5. Failure: Chaning time scale in UKF does no change results when other parems are changed accoridngly (@testUKF.R#126) 
  6. Failure: Testing UKF against prev computed values (@testUKF.R#150) 
  7. Failure: UKF on simulated data works with exponential models with only one of the variables (@testUKF.R#216) 
  8. Failure: UKF on simulated data works with exponential models with only one of the variables (@testUKF.R#236) 
  9. Failure: UKF on simulated data works with exponential models with only one of the variables (@testUKF.R#256) 
  1. ...
  
  Error: testthat unit tests failed
  Execution halted