-
Notifications
You must be signed in to change notification settings - Fork 46
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
[ENH] Log normal distribution #22 #214
Conversation
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.
Nice!
A few things about mechanics of making PR:
- you have committed some pycache files, these should not be tracked. Your
.gitignore
might not be setup properly? - You are making changes to empirical and laplace too, is that by accident?
Hey, In laplace I only changed a comment, empirical was by accident. I'll setup the .gitignore properly and make all the necessary changes soon. Apologies for the delay, I appreciate the review. |
@@ -3,7 +3,9 @@ | |||
# copyright: skpro developers, BSD-3-Clause License (see LICENSE file) | |||
# adapted from sktime | |||
|
|||
__all__ = ["Laplace", "Normal"] | |||
__all__ = ["Log-Normal","Empirical", "Laplace", "Normal"] |
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.
what state of the repository are you branching off from? This does not look like the most recent version, it looks like it is half a year old. Please make sure you update your fork regularly.
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 think there is still an issue with your pull request, you seem to be branching off a much earlier version of the repository. Make sure your fork is up to date, you can do that on GitHub by clicking "sync fork" at the top right.
That's why your changes are being shown as conflicting.
If you update your branch, it will probably throw a lot of merge errors.
I would recommend to update your main
, and then start a new branch. Then, move only the lognormal
file over, and make changes to __init__
again.
d = self.loc[x.index, x.columns] | ||
mu_arr, sd_arr = d._mu, d._sigma | ||
|
||
c_arr = x*(2*self.cdf(x)-1)-2*exp((mu_arr+sd_arr**2)/2)*(self.cdf((np.log(x)-mu_arr-sd_arr**2)/sd_arr)+self.cdf(sd_arr/mu_arr**0.5)-1) |
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.
could you kindly write down the formula in math, or explain otherwise how you are getting this expression?
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.
Hey, so this is basically the CRPS score which is E[IX-xI] -0.5E[|X-X'|] from which I was unable to isolate the first term. Wolfram alpha too wasnt able to produce a closed form for the integral. Can we change the description of the energy method accordingly or would you rather we go by the approximation in the base class?
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.
Why don't we try to spend a short discussion on trying to see whether we can get somewhere. Removing it entirely is always an option.
A "trick" to isolate the first term is to observe that adding the same constant to x
and X
(so, the location parameter) should leave the formula unchanged.
Regarding the integral, which integral concretely are you feeding into Wolfram Alpha?
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.
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.
this looks correct. Now you need to add the limits. That should be an easy substitution, no? I recommend, do that manually. Use that
The number 0.707 etc should be
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.
moved discussion here: #219
@fkiraly please take a look. I haven't made any changes to empirical.py.
okay, I did that. Thank you |
I don't think that has worked, you need to resolve the conflicts: Here is the GitHub guide on the topic: |
No,no I havent committed the new branch yet, just made the changes locally. Was awaiting your response on the energy method dilemma. Thank you so much |
Ensuring your PR is up-to-date and non-conflicting is a basic requirement for proper review, so I'd recommend not to wait with anything until you fix that. |
right so I'll make a new PR and close this one. |
Reference Issues/PRs
#22
What does this implement/fix? Explain your changes.
Implemented a log normal probability distribution
Does your contribution introduce a new dependency? If yes, which one?
None
What should a reviewer concentrate their feedback on?
-energy method
Did you add any tests for the change?
no
Any other comments?
PR checklist
For all contributions
How to: add yourself to the all-contributors file in the
skpro
root directory (not theCONTRIBUTORS.md
). Common badges:code
- fixing a bug, or adding code logic.doc
- writing or improving documentation or docstrings.bug
- reporting or diagnosing a bug (get this pluscode
if you also fixed the bug in the PR).maintenance
- CI, test framework, release.See here for full badge reference
For new estimators
docs/source/api_reference/taskname.rst
, follow the pattern.Examples
section.python_dependencies
tag and ensureddependency isolation, see the estimator dependencies guide.