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

Add calcLogSum, calcChoiceProbs and combined calcLogSumChoiceProbs to HARK.interpolation. #209

Merged
merged 2 commits into from
Jan 18, 2019

Conversation

pkofod
Copy link
Contributor

@pkofod pkofod commented Nov 5, 2018

It works, and I use it in #200 #201 #206 , and given the discussion in #206 it seems that @mnwhite also do stuff with discrete choices. I'd prefer to have it somewhere in HARK instead of repeating it in the modules three times.

How does the name work for you @mnwhite ? I just chose something, but I'm actually quite indifferent. It could have Upper in it as well I guess. Is it a problem that it also calculates the policies?

I have some tests as well, one which can be seen at pkofod#3 , that I can add after #208 is (potentially) merged.

@mnwhite
Copy link
Contributor

mnwhite commented Nov 5, 2018 via email

@pkofod pkofod force-pushed the dtool branch 2 times, most recently from fd0c4ea to 4f89220 Compare January 17, 2019 10:07
@pkofod
Copy link
Contributor Author

pkofod commented Jan 17, 2019

@mnwhite I'd love to get some opinion wrt names. I changed the discreteEnvelope name to discreteLogSumProb, discreteLogSum and discreteProb. Now, these names are not 🔥, but I just wanted to split them since we didn't re-use any computations anyway. I'm very happy to change the names. Now, I know you can, but I'm using this all over the place (doing a negm solution of the IRA model), so it's more important for me to get this into a place where I can re-use it in other PRs, than how fast it is. Notice, this is an operation that is always done just after an interpolation/extrapolation step, so this is not the expensive part.

@mnwhite
Copy link
Contributor

mnwhite commented Jan 17, 2019

My preference for these functions is for the leading word to be a verb, maybe calc or eval.

I am almost in PR-clearing mode, I swear.

@pkofod
Copy link
Contributor Author

pkofod commented Jan 17, 2019

I am almost in PR-clearing mode, I swear.

No worries, I'm fine updating the different PRs simultaneously. It would just be neat to have this merged at some point, in some form, so I don't have to add the same code in multiple PRs. There are also some changes I havn't pushed to most of them, so maybe I'll get to it before you comment :)

But okay, something like calcLogSum, the question is just what to call the discrete policies / choice probabilities. calcLogSumCCPs calcLogSum and calcCPPs ? Unless CCPs is not easily understood as conditional choice probabilities outside of people working with discrete choice models regularly... It's just, calcPolicies might be a bit too generic. calcDiscretePolicies?

@mnwhite
Copy link
Contributor

mnwhite commented Jan 17, 2019 via email

@llorracc
Copy link
Collaborator

llorracc commented Jan 18, 2019 via email

@mnwhite
Copy link
Contributor

mnwhite commented Jan 18, 2019 via email

@llorracc
Copy link
Collaborator

llorracc commented Jan 18, 2019 via email

@pkofod
Copy link
Contributor Author

pkofod commented Jan 18, 2019

I like ChoiceProbs over any of my own suggestions, so I'm going to try to go with that. If Matt starts doubting his own past judgement, I'll be happy to follow suit. As long as we don't send out a release with the name included, we can always change it.

@pkofod pkofod changed the title Add discreteEnvelope to HARK.interpolation. Add calcLogSum, calcChoiceProbs and combined calcLogSumChoiceProbs to HARK.interpolation. Jan 18, 2019
@pkofod
Copy link
Contributor Author

pkofod commented Jan 18, 2019

I made adjustments according to the discussion. I've added some simple tests, but more can always be added. Especially for the "shocked" case, where there are none, but there are some values we can check with some simple inputs (related to the mean of the extreme value distribution) at a later point. Almost no functionality have tests so far anyway, so I don't think that should hold back the PR. I just want to get the name right, and then start using the functionality out of HARK.interpolation in the different PRs to avoid repetition of code / bugs in some versions.

@mnwhite
Copy link
Contributor

mnwhite commented Jan 18, 2019

I just added a tiny commit with a comment block. I thought that would edit your branch, but it made a new pr/209 branch. I will merge that in, then close this PR.

@llorracc
Copy link
Collaborator

llorracc commented Apr 4, 2019

For release notes: calcLogSum, calcChoiceProbs, calcLogSumChoiceProbs added to HARK.interpolation

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.

4 participants