Monday, September 8, 2025

Parametric bootsrap of a mixed model

 Lately I have been tackling a problem about estimating precision and trueness of dental measurements. I know that a mixed effects model is a best way to reveal these estimates, so I go that way. 

I built some models with lm4::lmer and nlme::lme. Since lmer doesn't enable heterogenity in variances, I mainly focused on lme. I hadn't thought other packages like glmmTMB or similar although they might have best options. Since lme couldn't calculate 95% CIs, I wrote a simple script doing first nonparametric bootstrap, then parametric bootstrap. 

 I extracted variance components from the main by simulation, and calculated CIs for precision and trueness. Mixed models did a big job. 

But, after all those serious work for simulations, I discovered that parameters package have this ability builtin its functions like simulate_model and model_parameters. 

model_paramaters  didn't work smoothly but simulate_model did the same job what my code of 100+ lines and many hours of work did immediately. I was surprised by the magical ease those functions supplied. 

 

Thursday, August 7, 2025

xfun::attr() error in R

 I was getting errors in my pdf output files after rendering them.

## Warning in attr(.knitEnv$meta, "knit_meta_id"): 'xfun::attr()' is deprecated. ## Use 'xfun::attr2()' instead. ## See help("Deprecated")

This should be a problem with xfun/knitr packages of R. I tried to update them with no help. None of  the commands

 warning=FALSE

 knitr::opts_chunk$set(warning = FALSE)

options(warn = -1) 

would help neither. I then asked a solution to ChatGPT and it proposed the following hacky way which worked like a charm

sink("tmp.txt")
suppressWarnings(rmarkdown::render("path/to/yourfile.rmd"))
sink()

 

Wednesday, August 6, 2025

Julia error 'OPENSSL_3.3.0' not found

 On my Fedora 42 desktop I was getting errors like 

julia> import Pluto
ERROR: InitError: could not load library "/home/user/.julia/artifacts/1c2814ca8577e0356a6ecf8447364c19e97b86a8/lib/libssl.so"
/lib64/libcrypto.so.3: version `OPENSSL_3.3.0' not found (required by /home/user/.julia/artifacts/1c2814ca8577e0356a6ecf8447364c19e97b86a8/lib/libssl.so)
Stacktrace:
 [1] macro expansion
   @ ~/.julia/packages/JLLWrappers/m2Pjh/src/products/library_generators.jl:63 [inlined]
 [2] __init__()
   @ OpenSSL_jll ~/.julia/packages/OpenSSL_jll/2yAM9/src/wrappers/x86_64-linux-gnu.jl:16
during initialization of module OpenSSL_jll

when I try to start Pluto from within julia. This error is somewhat related to version of the openssl libraries installed on my computer. I say so, because on my laptop I have a similar installation, but no such errors (may be due to some libraries lacking on my laptop). 

Anyway, after some search (not search anymore of course, chatting), I installed OpenSSL 3.5 library locally on my desktop and succeeded to link it my julia install. I tried OpenSSL versions 3.3 and 3.4 without success. Lastly version 3.5 did link to julia with some preloading/pointing like 

alias julia_local='env LD_PRELOAD=$HOME/.openssl-3.3/lib64/libcrypto.so:$HOME/.openssl-3.3/lib64/libssl.so LD_LIBRARY_PATH=$HOME/.openssl-3.3/lib64:$LD_LIBRARY_PATH julia'

 I didn't make a system-wide install of OpenSSL 3.5 not to poison the system, and couldn't upgrade to that version using dnf neither. 

This was a good hack. Happy now.
 

Wednesday, May 28, 2025

Fedora Rstudio with Electron

 Some time has passed since RStudio's transition to Electron. I use Rstudio almost daily on Fedora. It became not as stable as it was before this transition to Electron. RStudio can became unstable especially on an external screen on my laptop and together with issues from Libreoffice.