OpenSourceEconomics/respy

Rename the criterion functions.

tobiasraabe opened this issue ยท 5 comments

  • respy version used, if any: any
  • Python version, if any: any
  • Operating System: any

What would you like to enhance and why? Is it related to an issue/problem?

We build the criterion function for estimation with ML with

criterion_function = rp.get_crit_func(...)

Since we have more than one estimation method, get_crit_func() is ambiguous and we should provide a good default name for the left-hand side of the assignment.

The convention for estimation with MSM is currently:

msm = rp.get_msm_func(...)

which is method-based.

I am more in favor of a name which describes what the output is. It is not intuitive to pass the result of get_msm_func or get_ml_func to an estimagic function which calculates standard errors of parameters, e.g., on log likelihood contributions of observations.

Describe the solution you'd like

Maybe something like this:

log_like = rp.get_log_like_func()
log_like_contribs = rp.get_log_like_func(return_scalar=False)

weighted_sum_squared_errors = rp.get_moment_errors_func()
weighted_errors = rp.get_moment_errors_func(return_scalar=False) 

@peisenha, @janosg, @mo2561057, @amageh What are your thoughts? We should resolve this issue before the release.

I am in favor of this change and I think using output based names is a good idea. I could take over this issue and implement the changes in #364 along with it if you want. How much would that conflict with what everyone is currently working on?

I like the names.

@amageh We should wait after #342 is merged, but then might be a good point. Later tutorials and guides will be forced to use the new names.