-
Notifications
You must be signed in to change notification settings - Fork 3
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
basic truncated normal dist #36
base: main
Are you sure you want to change the base?
Conversation
f0343da
to
69569ce
Compare
if lower is not None and mu is not None and sigma is not None: | ||
a = (lower - mu) / sigma | ||
|
||
if upper is not None and mu is not None and sigma is not None: |
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.
@ev-br sorry to bother you. any thoughts on how to deal with missing parameters when fitting? this method seems almost useless if you need 3 parameters just to fix one.
In other words, scipy.stats.truncnorm.fit(fa=<guess>)
will work, but paramnormal.truncated_normal.fit(lower=<guess>)
won't since you also need mu
and sigma
to estimate a
.
On the otherhand, if you're fitting truncnorm
distributions and you have a guess for a
, does it follow that you implicitly have a guess for sigma and mu?
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.
Geez, that's confusing! A quick thought, likely rubbish --- how about say, fixing upper
and lower
from the extent of the data and then calling truncnorm.fit_loc_scale
to estimate mu
and sigma
?
References | ||
---------- | ||
http://scipy.github.io/devdocs/generated/scipy.stats.truncnorm | ||
https://en.wikipedia.org/wiki/Rice_distribution |
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.
Rice?
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.
Good catch and I didn't know about fit_loc_scale
! Will check it out.
On Fri, Jul 29, 2016 at 5:03 AM Evgeni Burovski [email protected]
wrote:
In paramnormal/dist.py
#36 (comment):
- and
- .. math::
b = \frac{x_{\mathrm{upper bound}} - \mu}{\sigma}
- Since
a
andb
are directly linked to the location and scale- of the distribution as well as the lower and upper limits,
- respectively, it's difficult to use the
fit
method of this- distirbution without either knowing a lot about it
a priori
or- assuming just as much.
- References
Rice?
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
https://github.com/phobson/paramnormal/pull/36/files/c30f4bcfcc2a0e8b426c322d7eb383556547d7af#r72780884,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABHCowITbToKZ4dE3_fR0uKTVadumbB6ks5qaev4gaJpZM4HvL4U
.
closes #35