-
Notifications
You must be signed in to change notification settings - Fork 33
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
Restructure likelihood.py for #310 and estimagic's comparison plot. #313
Conversation
from respy.shared import downcast_to_smallest_dtype | ||
from respy.shared import generate_column_dtype_dict_for_estimation | ||
from respy.shared import rename_labels_to_internal | ||
from respy.solve import solve_with_backward_induction | ||
from respy.state_space import StateSpace | ||
|
||
|
||
def get_crit_func(params, options, df, version="log_like"): | ||
def get_crit_func( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the new interface. I think just passing the params is the best option!
Codecov Report
@@ Coverage Diff @@
## master #313 +/- ##
========================================
Coverage ? 81.3%
========================================
Files ? 38
Lines ? 2493
Branches ? 0
========================================
Hits ? 2027
Misses ? 466
Partials ? 0
Continue to review full report at Codecov.
|
Solution / Implementation
We need to change some parts of the likelihood calculation from NumPy arrays to DataFrames which makes the distribution of the estimation over the dense state space easier. It is similar to what happened in Simplify simulation and prepare for #310. #312.
The likelihood function has two indicators.
return_scalar
defines whether the mean log likehood or contributions will be returned. This is essential to switch between estimation and standard error calculation.return_comparison_plot_data
allows to return a DataFrame in the tidy data format which can be used to visualize the evolution of likelihoods during the estimation! One can plot the distributions of choice and wage likelihoods for periods, individuals, choices, and types.Type probabilities are added to the comparison plot in Separate core and dense state space. #310.