# spaMM.options(example_maxtime=60) # keep it handy... # spaMM.options(projpath="D:/home/francois/travail/stats/spaMMplus/spaMM") if (file.exists((privdata <- paste0(spaMM::projpath(),"/../tests_misc/ranCoefs/all_fitness.txt")))) { cat(crayon::yellow("\ntest ranCoefs:")) my.data <- read.table(privdata, header = TRUE, sep = "\t",dec = ".") my.data$line <- factor(as.character(my.data$line)) my.data <- na.omit(my.data) if (TRUE) { (fitme3 <- fitme(total_red ~ sex*env + (1|rep) + (0 + env|line), data = my.data, method="ML")) how(fitme3) # 0.7s v3.0.34 # final precision depends on two steps ! And ultimately on HLfit/hatval precision in the refit testval3o <- 1559.81264462379 ## sph gives practically the same result but longer zut <- try(testthat::expect_equal((res3o <- attr(attr(fitme3,"optimInfo")$optim.pars,"optr")$objective), testval3o,tolerance=1e-8),silent=TRUE) if (inherits(zut,"try-error")) { if (res3o>testval3o) strg <- " poorer" else strg <- " better" cat(paste0("objective from fitme3's optimInfo=", res3o, strg, " than tested value ",testval3o," by ",res3o-testval3o ,"\n")) } testval3f <- -1559.812644545275 zut <- try(testthat::expect_equal((res3f <- logLik(fitme3)[[1L]]), testval3f,tolerance=1e-8),silent=TRUE) if (inherits(zut,"try-error")) { if (res3f20) { if (file.exists((privtest <- paste0(spaMM::projpath(),"/package/tests_private/test-rC_transf.R")))) { source(privtest) } (HLfit3 <- HLfit(total_red ~ sex*env + (1|rep) + (0 + env|line), data = my.data, HLmethod="ML")) how(HLfit3) # 2.2s v3.0.34 testval3h <- -1559.81264432437 # chol -- better than ever; fit is singular... zut <- try(testthat::expect_equal((res3h <- logLik(HLfit3)[[1L]]), testval3h,tolerance=1e-8),silent=TRUE) if (inherits(zut,"try-error")) { if (res3htestval6o) strg <- " poorer" else strg <- " better" cat(paste0("objective from fitme6's optimInfo=", res6o, strg, " than tested value ",testval6o," by ",res6o-testval6o ,"\n")) } testval6f <- -1536.080805075333 # chol -- good zut <- try(testthat::expect_equal((res6f <- logLik(fitme6)[[1L]]), testval6f,tolerance=1e-8),silent=TRUE) if (inherits(zut,"try-error")) { if (res6f