I am developing a program that will be run on a daily basis, but will use Mata objects that only change weekly. I would like to save and load these objects throughout the week without re-creating them (since it takes 3-4 hours to make them).
In the documentation and online, I have come across no way of saving Mata objects directly.
I could conceivably save them by exporting to Stata, but they are not rectangular so (i) I would need to figure out how (if at all) it is possible to convert my objects into tables; and (ii) converting to and from Stata format would likely be very inefficient.
When I say they are not rectangular, I mean...
I'm just wondering if there is another way that I have missed. I can imagine facing messier data structures, and there certainly is some (albeit small) computational cost associated with the conversion in the case I'm facing now.
In the documentation and online, I have come across no way of saving Mata objects directly.
I could conceivably save them by exporting to Stata, but they are not rectangular so (i) I would need to figure out how (if at all) it is possible to convert my objects into tables; and (ii) converting to and from Stata format would likely be very inefficient.
When I say they are not rectangular, I mean...
- I have a column vector of pointers to vectors of row numbers. This describes a directed graph (starting from this row, which rows can I go to?).
- I have a matrix-valued function that I am evaluating on a grid of inputs and saving with asarray(fun,idx,mat)
I'm just wondering if there is another way that I have missed. I can imagine facing messier data structures, and there certainly is some (albeit small) computational cost associated with the conversion in the case I'm facing now.
Comment