Running ‘testthat.R’ [332s/390s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(disaggregation)
  > 
  > test_check("disaggregation")
  Fitting model. This may be slow.
  Saving _problems/test-fit-model-36.R
  The data contains 100 polygons and 400 pixels
  The largest polygon contains 4 pixels and the smallest polygon contains 4 pixels
  There are 2 covariates
  
  Covariate summary:
       layer1           layer2      
   Min.   :-4.959   Min.   :-3.855  
   1st Qu.: 5.277   1st Qu.: 6.271  
   Median :10.511   Median :10.356  
   Mean   :10.314   Mean   :10.707  
   3rd Qu.:15.348   3rd Qu.:15.376  
   Max.   :30.518   Max.   :25.901  
  They data contains 100 polygons and 400 pixels
  The largest polygon contains 4 pixels and the smallest polygon contains 4 pixels
  There are 2 covariates
  Likelihood function: poisson 
  Link function: log 
  Model parameters:
                         Estimate Std. Error
  intercept          4.2756268196 0.31914423
  layer1            -0.0001739207 0.01914202
  layer2             0.0024384771 0.02026860
  iideffect_log_tau -0.0919133266 0.15116446
  log_sigma         -2.1893325606 1.02069628
  log_rho            2.6609990607 0.82350557
  
  Model convergence: 0 (relative convergence (4))
  Negative log likelihood:  -274.385178635507 
  
  In sample performance:
         RMSE       MAE   pearson spearman log_pearson
  1 0.9388664 0.6762971 0.9999981        1   0.9982112
  Bayesian disaggregation model result
  
  Likelihood function: poisson 
  Link function: log 
  
  Parameter values:
          intercept            layer1            layer2 iideffect_log_tau 
       4.2756268196     -0.0001739207      0.0024384771     -0.0919133266 
          log_sigma           log_rho 
      -2.1893325606      2.6609990607 
  Predction from disaggregation model
  
  Components of the model: covariates field 
  
  There are 100 uncertainty realisations
  
  The mean predicted values range from 69.2 to 78.5 
  The predicted IQR takes values from 33.8 to 133 
  Predction from disaggregation model
  
  Components of the model: covariates field 
  
  There are 100 uncertainty realisations[ FAIL 1 | WARN 0 | SKIP 0 | PASS 293 ]
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test-fit-model.R:36:3'): disag_model with 1 covariate behaves as expected ──
  Error in `stats::nlminb(obj$par, obj$fn, obj$gr, control = list(iter.max = iterations, trace = 0))`: NA/NaN gradient evaluation
  Backtrace:
      ▆
   1. └─disaggregation::disag_model(...) at test-fit-model.R:36:3
   2.   └─stats::nlminb(...)
  
  [ FAIL 1 | WARN 0 | SKIP 0 | PASS 293 ]
  Error:
  ! Test failures.
  Execution halted