piecewise-regression icon indicating copy to clipboard operation
piecewise-regression copied to clipboard

Abbrivations

Open mshemuni opened this issue 1 year ago • 2 comments

Hello,

I'd like to express my gratitude for your efforts in creating this valuable tool.

I have a few suggestions that I believe could enhance the user experience and improve the documentation:

  1. Improved Variable Naming in get_results(): The get_results() function returns a wealth of useful information. However, the use of abbreviations such as se, t_stat, p_t, bic, or rss might be challenging for users from diverse fields. See: this Software Engineering Stack Exchange post.

  2. Example Usage for get_results() and get_params() in Documentation: While get_results() and get_params() are excellent methods, the documentation lacks examples illustrating their usage. Adding clear examples, possibly with simple mathematical models like the ones below, would significantly benefit users:

    $$ y = const + α1⋅x $$

    $$ y = const - β1+ α2⋅(x − breakpoint1) $$

  3. Introduce a Function for Returning a List of Fits: It would be valuable to introduce a new function that returns a list of fits, such as [fit_1, breakpoint1, fit_2, breakpoint2]. Each fit (e.g., fit_1) could be a callable function that accepts xs and returns corresponding ys based on the fit.

Thank you for considering these suggestions. I believe these enhancements will contribute to the overall usability and understanding of your tool.

I already forked the repository and fixed the Variable Naming in get_results(). I can request a merge. However Wanted to share my thoughts here first.

mshemuni avatar Feb 23 '24 23:02 mshemuni

Hi. Thank you for the suggestions! Great to get some feedback.

  1. Yes I agree it is better not to abbreviate variable names. That's great that you have forked the repo and made the changes. yes please suggest a merge and I will check it.
  2. Yes I agree that adding something like that to the docs would be beneficial. I can do that or please feel free to go ahead and fork it again/add it to the existing fork if you would like to suggest specific changes.
  3. I'm not sure the context of returning a list of fits? Do you mean return the fits as they were iterated during the optimisation algorithm?

Thank you Charlie

chasmani avatar Feb 26 '24 15:02 chasmani

Nope. I maen returning lisf of callable functions that are fits to each segments. For example:

f1 = np.poly1d([0, results["alpha1"], results["const"]])
f2 = ...
fits = [f1, f2]

mshemuni avatar Feb 26 '24 15:02 mshemuni