Skip to content
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

adding necessary functions to time_iteration docstring #205

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

sbenthall
Copy link
Contributor

Adding a mention of transition and arbitrage to parameter docs.

Is this kind of change welcome?

@sbenthall
Copy link
Contributor Author

It appears that an arbitrage equation has the signature:

m, s, x, M, S, X, p -> r1, r2

What are r1 and r2?

@albop
Copy link
Member

albop commented Jul 8, 2020

Adding a mention of transition and arbitrage to parameter docs.

Is this kind of change welcome?

Yes this is very helpful. When the doc is stable we could link to the algorithm mathematical description

@albop
Copy link
Member

albop commented Jul 8, 2020

It appears that an arbitrage equation has the signature:

m, s, x, M, S, X, p -> r1, r2

What are r1 and r2?

I'm a bit surprised. In the core definition, the result is r with the same size as x. As a standard function you can call it directly, r = arbitrage(...) or r, r_m, r_s, r_x, r_M, r_S, r_X=arbitrage(..., diff=True) in which case you get the derivative w.r.t. to all variables except the last. One way to gather all derivatives together is r, *r_=arbitrage(..., diff=True). Is this what you saw ?

@albop
Copy link
Member

albop commented Jul 8, 2020

Ah, I just saw where the confusion might come from. In the self contained example, you get something like:

@jit(nopython=True)
def arbitrage_(m, s, x, M, S, X, p):

    res_1 = χ*n**η*c**σ - w                    
    res_2 = 1 - β*(c/C)**(σ)*(1-δ+R) 

    return (res_1, res_2)

In this example, (res_1, res_2) represents one vector of size 2, same as vector x, which can also be seen as a tuple of two elements.
The reason, I use tuples for the vectors in the jitted functions is because the compiler knows their size and can optimize them away (contrary to numpy arrays).

@sbenthall
Copy link
Contributor Author

In this PR, I've added something to this page that briefly overviews the necessary functions for each of the solution algorithms:
https://dolo.readthedocs.io/en/latest/algos.html

I see now where these equations are defined, here:
https://dolo.readthedocs.io/en/latest/algos.html

Perhaps I was being dense not finding them earlier. But I will put some thought into how to create a "dictionary" or "cheat sheet" to make it easier to look up the definition of one of the technical terms that appears in the model language.

I expect doing this correctly will involve clean use of the markup language to manage internal links within the documentation. I also understand that the documentation is currently in flux? Maybe I can revisit this once the MakeTheDocs are more complete.

@albop
Copy link
Member

albop commented Jul 9, 2020

Thanks. Tell me when you want to merge this PR. As for the mkdocs, I expect to complete the transition by the end of next week (and get rid of all concurrent versions of the docs). I just need to figure out how to autodocument python functions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants