subsets of model equations
Posted: Tue Mar 05, 2024 3:08 pm
Hello, I have a question with regards to model objects, and making models that are subsets of larger models.
Assume you have a model object, in a work file with 1000 estimated equations (call them y1, y2, ….y1000), model name mod1. I am attempting to take a subset of that model, call it mod2 with a subset of mod1’s equations (y400, y401,…y499) and run a simulation with this partial model. As the equations in the full model change quarterly (new equations added or dropped etc.), I am looking for a way to specify the equations to pull to create a new model object (that is a subset of the whole model), as opposed to specifying the equations to drop.
Assume mod1 is the full 1000 equation model, I am trying to make an object called mod2 which has equations y400,y401,…y499. I assumed there would be a command like:
Copy mod1 mod2
Mod2.keep y400, y401, y402, ... y499
or alternativly, something like:
model mod2
mod2.merge mod1::y400
mod2.merge mod1::y401
.....
Where all of the other equations would be dropped from the mod2 except those specified to keep (or only those explicitely staed are merged with the new model). Since equations change quarterly, I cannot use the mod2.drop command, and specify the compliment of the set (y400,y401,…) since the list is dynamic, and it is very large. I notice however, that using the model.merge command, I can only copy over the entire model, and not a model subset (my equations are txt format in the model object). I would love if anyone has any insight into solving this problem! :)
Assume you have a model object, in a work file with 1000 estimated equations (call them y1, y2, ….y1000), model name mod1. I am attempting to take a subset of that model, call it mod2 with a subset of mod1’s equations (y400, y401,…y499) and run a simulation with this partial model. As the equations in the full model change quarterly (new equations added or dropped etc.), I am looking for a way to specify the equations to pull to create a new model object (that is a subset of the whole model), as opposed to specifying the equations to drop.
Assume mod1 is the full 1000 equation model, I am trying to make an object called mod2 which has equations y400,y401,…y499. I assumed there would be a command like:
Copy mod1 mod2
Mod2.keep y400, y401, y402, ... y499
or alternativly, something like:
model mod2
mod2.merge mod1::y400
mod2.merge mod1::y401
.....
Where all of the other equations would be dropped from the mod2 except those specified to keep (or only those explicitely staed are merged with the new model). Since equations change quarterly, I cannot use the mod2.drop command, and specify the compliment of the set (y400,y401,…) since the list is dynamic, and it is very large. I notice however, that using the model.merge command, I can only copy over the entire model, and not a model subset (my equations are txt format in the model object). I would love if anyone has any insight into solving this problem! :)