Running ‘testthat.R’ [588s/512s]
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         Patched                                    
  major          3                                          
  minor          4.0                                        
  year           2017                                       
  month          06                                         
  day            17                                         
  svn rev        72807                                      
  language       R                                          
  version.string R version 3.4.0 Patched (2017-06-17 r72807)
  nickname       You Stupid Darkness                        
  > 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 relative difference: 0.9941582
  Component "state_vars": Mean relative difference: 0.9999633
  
  
  2. Failure: UKF does not fail and both methods give the same (@testUKF.R#94) ---
  res_new$state_vecs not equal to res_old$state_vecs.
  44/44 mismatches (average diff: 564)
  [1] -4.57 -   -10.4 ==    5.83
  [2] -4.57 -  -627.5 ==  622.88
  [3] -4.57 -  -893.1 ==  888.54
  [4] -4.57 -  -951.6 ==  947.04
  [5] -4.57 - -1176.4 == 1171.78
  [6] -4.57 - -1512.4 == 1507.85
  [7] -4.57 - -1537.6 == 1533.04
  [8] -4.57 - -1530.1 == 1525.56
  [9] -4.57 - -1439.7 == 1435.16
  ...
  
  
  3. Failure: UKF does not fail and both methods give the same (@testUKF.R#95) ---
  res_new$state_vars not equal to res_old$state_vars.
  176/176 mismatches (average diff: 12243)
  [1]  9.71e-11 -  0.7375 == -0.7375
  [2] -4.19e-11 - -0.2647 ==  0.2647
  [3] -1.92e-10 -  0.0491 == -0.0491
  [4]  1.04e-10 - -0.3105 ==  0.3105
  [5] -4.19e-11 - -0.2647 ==  0.2647
  [6]  2.22e-10 -  0.2014 == -0.2014
  [7] -3.04e-11 - -0.0246 ==  0.0246
  [8] -3.88e-10 -  0.1281 == -0.1281
  [9] -1.92e-10 -  0.0491 == -0.0491
  ...
  
  
  4. 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: 1.24)
  [1] -3.51 - -2.53 == -0.984
  [2] -3.51 - -2.53 == -0.984
  [3] -3.51 - -2.53 == -0.984
  [4] -3.51 - -2.53 == -0.984
  [5] -3.51 - -2.53 == -0.984
  [6] -3.51 - -2.53 == -0.984
  [7] -3.51 - -2.53 == -0.984
  [8] -3.51 - -2.53 == -0.984
  [9] -3.51 - -2.53 == -0.984
  ...
  
  
  5. Failure: Testing UKF against prev computed values (@testUKF.R#150) ----------
  `res` not equal to read_to_test("UKF2").
  Component "state_vars": Mean absolute difference: 0.1369361
  Component "Q": Mean absolute difference: 0.7896617
  
  
  6. 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: 233.0384
  Component "state_vecs": Mean relative difference: 0.9640748
  Component "Q": Mean relative difference: 1241.364
  
  
  7. 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: 283685.8
  Component "state_vecs": Mean relative difference: 0.9706488
  Component "Q": Mean relative difference: 6648823
  
  
  8. 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: 7.959749
  Component "state_vecs": Mean relative difference: 0.9643669
  Component "Q": Mean relative difference: 40.89949
  
  
  9. 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.7878741
  Component "state_vars": Mean relative difference: 0.9233284
  Component "Q": Mean relative difference: 0.9520697
  
  
  
  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_... 
  10. 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 
  11. 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 absolute difference: 0.05322651
  Component "state_vecs": Mean relative difference: 0.8383466
  Component "Q": Mean absolute difference: 0.9979208
  
  
  12. 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 absolute difference: 0.2600507
  Component "state_vecs": Mean relative difference: 1.010317
  Component "Q": Mean absolute difference: 0.7373966
  
  
  13. 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: 6.152233
  Component "state_vecs": Mean relative difference: 1.208298
  Component "Q": Mean relative difference: 0.9792776
  
  
  
  Finished fixed_effects_like_recursive_least_squares 
  
  Running testfixed_terms_est_in_M_step 
  14. 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 relative difference: 4476751
  Component "state_vecs": Mean relative difference: 1.046549
  Component "fixed_effects": Mean relative difference: 1
  
  
  15. Error: UKF with fixed effects works (@testfixed_terms_est_in_M_step.R#151) -
  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) ~ -1 + ddFixed(rep(1, length(x1))) + 
         ddFixed(x1) + x2 + x3), data = sims$res, model = "exp_clip_time_w_jump", by = 1, 
         id = sims$res$id, max_T = 10, control = list(method = "UKF", fixed_terms_method = "M_step")) at testthat/testfixed_terms_est_in_M_step.R:151
  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")
  
  
  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 
  
  Finished residuals 
  
  Running static_glm 
  
  Finished static_glm 
  
  Running test_utils 
  
  Finished test_utils 
  
  Running weights 
  16. 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: 4.24)
  [1]  -7.627 - -1.142 == -6.49
  [2] -10.232 - -1.142 == -9.09
  [3]   0.125 - -1.108 ==  1.23
  [4]  -4.930 - -1.226 == -3.70
  [5]  -3.842 - -1.232 == -2.61
  [6]  -6.160 - -1.272 == -4.89
  [7]   5.922 -  0.339 ==  5.58
  [8]   7.923 -  0.339 ==  7.58
  [9]  -0.792 -  0.387 == -1.18
  ...
  m = logit
  
  17. 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: 5.71)
  [1]  0.685 -  0.1016 ==  0.584
  [2] -0.376 - -0.0474 == -0.329
  [3] -0.376 - -0.0474 == -0.329
  [4]  0.506 -  0.1338 ==  0.372
  [5]  1.247 -  0.0666 ==  1.180
  [6] -1.220 - -0.0523 == -1.168
  [7] -1.220 - -0.0523 == -1.168
  [8]  1.263 -  0.0953 ==  1.168
  [9]  8.474 -  0.0586 ==  8.416
  ...
  m = logit
  
  18. 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.2)
  [1] -23.7 - -3.006 == -20.7
  [2] -23.7 - -3.006 == -20.7
  [3] -23.7 - -2.844 == -20.9
  [4] -23.7 - -2.978 == -20.7
  [5] -23.7 - -2.975 == -20.7
  [6] -23.7 - -3.024 == -20.7
  [7] -13.5 -  0.126 == -13.6
  [8] -13.5 -  0.127 == -13.6
  [9] -13.5 -  0.309 == -13.8
  ...
  m = exp_bin
  
  19. 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.267)
  [1]  0.211352 -  0.1070 ==  0.1043
  [2]  0.080978 - -0.0388 ==  0.1198
  [3]  0.080978 - -0.0388 ==  0.1198
  [4]  0.088207 -  0.1351 == -0.0469
  [5]  0.001452 -  0.0684 == -0.0669
  [6] -0.000404 - -0.0481 ==  0.0477
  [7] -0.000404 - -0.0481 ==  0.0477
  [8]  0.001872 -  0.0916 == -0.0897
  [9]  0.279661 -  0.0578 ==  0.2219
  ...
  m = exp_bin
  
  20. 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.49 - -3.707 == -14.79
  [2] -18.51 - -3.769 == -14.74
  [3] -18.51 - -2.530 == -15.98
  [4] -18.51 - -3.388 == -15.12
  [5] -18.51 - -3.636 == -14.87
  [6] -18.51 - -3.761 == -14.75
  [7]  -5.93 - -0.569 ==  -5.36
  [8]  -5.93 - -0.628 ==  -5.30
  [9]  -5.93 -  0.496 ==  -6.43
  ...
  m = exp_clip_time
  
  21. 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.162)
  [1]  0.1641 - 0.4321 == -0.2680
  [2]  0.0217 - 0.2154 == -0.1938
  [3]  0.0217 - 0.2154 == -0.1938
  [4]  0.0846 - 0.4205 == -0.3359
  [5]  0.0194 - 0.2464 == -0.2270
  [6] -0.0160 - 0.0805 == -0.0965
  [7] -0.0160 - 0.0805 == -0.0965
  [8]  0.0272 - 0.2763 == -0.2491
  [9]  0.1964 - 0.2516 == -0.0551
  ...
  m = exp_clip_time
  
  22. 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: 18.3)
  [1] -30.07 - -3.1254 == -26.95
  [2] -30.03 - -3.1264 == -26.90
  [3] -30.03 - -2.9107 == -27.12
  [4] -30.03 - -3.0861 == -26.94
  [5] -30.03 - -3.0749 == -26.95
  [6] -30.03 - -3.1118 == -26.91
  [7]  -9.64 -  0.0418 ==  -9.68
  [8]  -9.63 -  0.0421 ==  -9.67
  [9]  -9.63 -  0.2492 ==  -9.88
  ...
  m = exp_clip_time_w_jump
  
  23. 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.316)
  [1]  0.28069 -  0.1164 ==  0.1643
  [2]  0.07736 - -0.0363 ==  0.1137
  [3]  0.07736 - -0.0363 ==  0.1137
  [4]  0.07651 -  0.1436 == -0.0671
  [5]  0.00369 -  0.0736 == -0.0699
  [6] -0.00112 - -0.0484 ==  0.0473
  [7] -0.00112 - -0.0484 ==  0.0473
  [8]  0.00327 -  0.0986 == -0.0953
  [9]  0.40285 -  0.0611 ==  0.3418
  ...
  m = exp_clip_time_w_jump
  
  
  Finished weights 
  testthat results ================================================================
  OK: 2162 SKIPPED: 0 FAILED: 23
  1. Failure: UKF on head_neck works with logit model (@testUKF.R#64) 
  2. Failure: UKF does not fail and both methods give the same (@testUKF.R#94) 
  3. Failure: UKF does not fail and both methods give the same (@testUKF.R#95) 
  4. Failure: Chaning time scale in UKF does no change results when other parems are changed accoridngly (@testUKF.R#124) 
  5. Failure: Testing UKF against prev computed values (@testUKF.R#150) 
  6. Failure: UKF on simulated data works with exponential models with only one of the variables (@testUKF.R#216) 
  7. Failure: UKF on simulated data works with exponential models with only one of the variables (@testUKF.R#236) 
  8. Failure: UKF on simulated data works with exponential models with only one of the variables (@testUKF.R#256) 
  9. Failure: UKF and exp models give previous computed results for head_neck (@testUKF.R#319) 
  1. ...
  
  Error: testthat unit tests failed
  Execution halted