-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
working out an expanded Dolo/DolARK syntax #14
Comments
@llorracc Some clarifying questions/comments:
I believe having multiple arbitrage functions would entail not just a change to the dolang YAML syntax, but also a change to the Model class created after parsing the YAML.
It follows then that (1) and (2) are high priority for inclusion in Dolang syntax. Any elaboration on those specific points would be helpful in moving that ball forward. |
all endogenous states
and transition functions
probably this will usually be true in practice but there is no reason to require it
The simplest way to implement this would be to have a separate file for each "period" within the "epoch" (like, each "quarter" within the year). That's probably not the best way to implement it, though, because there are SOME requirements for consistency across the periods, and completely separate YAML files would have no way of imposing that. A simple example that could be used to develop a syntax for this is the portfolio problem: There's a fairly complete exposition of this in my SolvingMicroDSOPs lecture notes (not the HARK REMARK -- the original lecture notes at llorracc/SovingMicroDSOPs (Google it).
That works in principle, but does not work well in practice, because the way state variables are represented in Dolo is as symmetric matrices. If we want to solve a life cycle problem where the maximum span of life is 120 years (when you reach age 120, probability of death becomes 100 percent), then a symmetric matrix would require the specification of a matrix of size 120 by 120 (for the annual version) to capture the probability that a person who is age 1 transitions to age 119. Of course that probability is zero -- and indeed the matrix is entirely empty except for a single entry in each row, which determines that the probability of transitioning to the next age is 1. There are ways to handle this ("sparse matrices") computationally but they rapidly get complex to code. It's much much simpler to have a sequence of 120 problems (the problem of the 120 year old; the problem of the 119-year-old, etc). There are two issues here:
While in principle these are separable, in practice it is likely that it will be wise to construct a syntax that maps reasonably transparently into the likely computational solution method.
Agreed.
It also does not exist in Dolo, which means that we face fewer constraints in how to implement it than for some other things. |
This is to follow up on some of the things I was saying in our call earlier today.
My sense is that the most effective way for you to try to wrap your mind around what we want to do would be to start with some examples of our simplest models that currently ARE ALREADY solved correctly in both Dolo and HARK, like the Buffer Stock model, and to get thoroughly familiar with how the model is represented:
For the BST model:
The DARKolo repo has a number of other models that are desired but are not in nearly the state of completion as the BST DARKolo. I'd suggest that after you get BST under your belt, you examine some of those and pick one or two which deserve a parallel treatment as above. Once you've done that, you could take a look at some of our models that are NOT conveniently representable in Dolo syntax (I'm not sure of the state of DolARK), and wrap your mind around why (like, the life cycle/finite horizon aspect). Specifically, I'd suggest the SolvingMicroDSOPs REMARK because that one also has the math elaborately specified in my SolvingMicroDSOP lecture notes. |
You have given me enough information to try to work out a proposed syntax for this. Given that, I'm not sure why you think the parallelism exercise you have suggested is useful. When I have tried what you've proposed, I've wound up hung up on the instability of Dolo and the inscrutability of HARK. It has not been a productive course of action. If the syntax is what matters most to you, that can be developed without messing with either library.
I anticipated this response. I am confused. On the one hand, you are saying that your first priority is the syntax, and the syntax alone. On the other hand, you seem to be rejecting a syntax because of its effect on the complexity of the model that is interpreted from it. What if the compiler could interpret a concise syntax and create an object with the properties you described (120 different sub-problems). I find it hard to believe anybody would be interested in hand-coding 120 sub-problems themselves. Or am I missing something you are imagining about the potential syntax? Perhaps a special notation for a constrained type of endogenous state, one which affords an efficient multi-stage model representation? That would, technically, not only be a new syntax for Dolo, but also a new semantics. In other words, I believe that with both of these proposals, the underlying Model object would, ultimately, need to be changed to support what you are proposing. However, you seem very willing to bracket those implementation questions for now. I think now that I have been working with @albop a bit more to understand Dolo, through the python constructor work, I'm in a better position to create a draft syntax aligned with what you've proposed. |
I've reviewed the task list for DARKolo chimera's, which has been around since last November, when I started. All of them besides BST have been blocked for one reason or another. I did not see on my first read of your second comment statement, which I'm happy to see though it seems to be inconsistent with your overall statement of priorities (wanting, mainly an unambiguous syntax for new kinds of problems), this point:
I agree that this is worthwhile to do. It is yet another motivation for my work on a Python constructor for Dolo models. When that constructor is written, it will be possible to add this to the BST chimera. |
I see now that there is already a proposed convention for this in the I see now that this issue was misplaced when it was written. It would make more sense for these items to be individually ticketed on the dolark repository, as that's where the new syntax interpretation will be implemented. |
As this issue has expanded in scope to cover a wide variety of tasks, I'll close it when those tasks are individually represented in other issues. RE: the syntax requests in the original post, these are now addressed in:
These are covered in the issues in this repository, such as #6 #12 #13
This is already available as a DARKolo chimera, though it needs updating: #15
|
From @llorracc
The text was updated successfully, but these errors were encountered: