I am fitting models with many thousands of variables, many of which I am not interested in at the analysis stage (a hierarchical HMM with per-trial forward variables). However, the “superfluous” variables make working with the model-object cumbersome and time-intensive. For example, storing a fitted model can produce files that are quite big (several GB) and loading/extracting variables is slow etc.
Is there a way to “drop” or remove variables from a fitted model-object? I am using both
cmdstanr (though I have come to prefer the latter), so I would be interested in solutions for both!
I know about methods to not include the variables during sampling by using blocks (but that’s not an option as I need the variables in the “generated quantities” block during sampling).
Operating System: Linux (Debian 6.3.0-18)
CmdStan Version: 2.26.1
Compiler/Toolkit: GCC 6.3.0 20170516