Articles

Comparison of models by AIC with or without log transformation on Y

You cannot compare the AIC or BIC when fitting to two different data sets i.e. 𝑌 and 𝑍. You only can compare two models based on AIC or BIC just when fitting to the same data set. Have a look at Model Selection and Multi-model Inference: A Practical Information-theoretic Approach (Burnham and Anderson, 2004). They mentioned my answer on page 81 (section 2.11.3 Transformations of the Response Variable): Investigators should be sure that all hypotheses are modeled using the same response variable (e.g., if the whole set of models were based on log(y), no problem would be created; it is the mixing of response variables that is incorrect). Akaike (1978, pg. 224) describes how the AIC can be adjusted in the presence of a transformed outcome variable to enable model comparison. He states: “the effect of transforming the variable is represented simply by the multiplication of the likelihood by the corresponding Jacobian to the AIC ... for the case of log{𝑦(𝑛)+1}, it is −2 ⋅∑log{𝑦(𝑛)+1},

Install textshaping package in ubuntu 22.04 and earlier

  sudo apt install libharfbuzz-dev libfribidi-dev libtiff5-dev Then you can install textshaping package On older Ubuntu releases before 22.04, you might have to cha nge it to: sudo apt install libharfbuzz-dev libfribidi-dev libtiff4-dev

Reinstall packages after Matrix update

If you have this error, it means that you must reinstall package after updating Matrix update.   > out3 <- lmer(formula = number ~ effect + (1 | Sector / Beach), data=dataF) Erreur dans initializePtr() : la fonction 'chm_factor_ldetL2' n'existe pas dans le package 'Matrix' The list of packages to be reinstalled is here: > tools::package_dependencies("Matrix", which = "LinkingTo", reverse = TRUE)[[1L]] Reinstall packages from source: install.packages("lme4", type = "source")

install ggdist for R 4.4 dev on Mac M2

 I get an error when I tried install ggdist package for R 4.4 dev on Mac M2. The dynamic library was not present at the correct place. Here is the solution: cd /Library/Frameworks/R.framework/Resources/lib/ ln -s /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/RcppParallel/lib/libtbb.dylib libtbb.dylib And it works.

Print messages on console during parallel computing

An exemple that print messages during parallel computing library(pbmcapply) # Can work with mclapply also cores <- 2 lazyChattySqrt <- function(num, name) {      # Sleep 2 seconds      Sys.sleep(2)      system(sprintf("echo '\nHello\n'"))      return(sprintf("Hello %s, the sqrt of %f is %f.", toString(name), num, sqrt(num)))  } chattyResult <- pbmclapply(1:3, lazyChattySqrt, "Bob", mc.cores = cores)

Install RNetCDF in Ubuntu 22

 I was force to do: cd /usr/lib/R/ mkdir share cd share mkdir make cd /usr/lib/R/share/make/ sudo ln -s /usr/share/R/share/make/shlib.mk shlib.mk And then in R,  install.packages("RNetCDF", type="source") was possible.