Optimizes AME model storage by converting matrices to sparse format.
compact_ame(fit, use_sparse_matrices = FALSE)Memory-optimized AME model object
Fitted AME model
Logical; whether to use sparse matrix storage (default: FALSE)
Cassy Dorff, Shahryar Minhas, Tosin Salau
When use_sparse_matrices = TRUE, the posterior-mean matrices
YPM and EZ are converted to sparse storage via the
Matrix package, but only when a matrix's nonzero density is below
0.5 -- converting a dense posterior-mean matrix would grow memory,
so denser matrices are left as ordinary dense matrices. For lame
fits, where YPM/EZ are per-period lists, the check and
conversion are applied per element. The additive-effect summaries
APM/BPM are named numeric vectors and are never converted.
Names and dimnames are preserved.