Incorrect values for .a and .b (min and max) for scipy.stats.uniform with non-default args
See original GitHub issueMy issue is about the definition of the attributes a and b (corresponding to min and max) for the scipy.stats.uniform distribution. These appear to always return 0 and 1 respectively, corresponding to the default values, regardless of the arguments.
Reproducing code example:
import scipy.stats as ss
x = ss.uniform(loc=5, scale=5)
print(x.a) # 0.0
print(x.b) # 1.0
The correct values should be 5.0 and 10.0.
Scipy/Numpy/Python version information:
1.5.4 1.18.2 sys.version_info(major=3, minor=6, micro=5, releaselevel='final', serial=0)
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (9 by maintainers)
Top Results From Across the Web
Confusion over `a` and `b` attributes from scipy.stats.uniform
It seems, regardless of the value I provide for loc and scale , the uniform -function returns a=0,b=1 . Compare that to e.g....
Read more >scipy.stats.uniform — SciPy v1.9.3 Manual
A uniform continuous random variable. In the standard form, the distribution is uniform on [0, 1] . Using the parameters loc and scale...
Read more >Imports from a custom module
When specifying a uniform distribution using the scipy.stats module the loc argument is the lower limit ($a$) and the scale argument is the...
Read more >GAMS — A User's Guide
contexts are very different. A direct assignment gives a desired value to a parameter before the solver is called. An equation definition also...
Read more >All my Homeworks
Then there is a problem of dublicate reference, which I am sure are ... where A and B are the parameters determined by...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@reinhold-willcox it sounds like
aandbwere really supposed to be private attributes used only by developers. Since the intended behavior is not actually documented, and because the way they work now is acceptable to the developers, the proposed fix in gh-13228 is not going to be merged, so I will close this issue, too. Sorry I couldn’t be of more help! Please use thesupportmethod in new code.The funny thing is that the initializer of the frozen distribution calls:
but
I wonder if this is intentional to call
_get_supportor if it should be callingsupport, e.g.Well, I’ll submit a PR and see what the pros think.