Skip to content
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

erroneous moment values for t-distribution #8786

Closed
tcrensink opened this issue Apr 30, 2018 · 2 comments
Closed

erroneous moment values for t-distribution #8786

tcrensink opened this issue Apr 30, 2018 · 2 comments
Labels
defect A clear bug or issue that prevents SciPy from being installed or used as expected good first issue Good topic for first contributor pull requests, with a relatively straightforward solution scipy.stats
Milestone

Comments

@tcrensink
Copy link

<<Please describe the issue in detail here, and for bug reports fill in the fields below.>>

Moments of the t-distribution return incorrect values. See: https://en.wikipedia.org/wiki/Student%27s_t-distribution

  • for df <= 1, the mean should be undefined
  • for df < 1, the variance should be undefined

Example:

from scipy import stats
X = stats.t(df=0.8)
X.mean() # returns 0
X.var() # returns inf

Scipy/Numpy/Python version information:

1.0.0 1.14.0 sys.version_info(major=3, minor=6, micro=4, releaselevel='final', serial=0)

@josef-pkt
Copy link
Member

AFAIK, the variance is inf and not undefined.
kurtosis is undefined because it divides by var (inf / inf)

@josef-pkt
Copy link
Member

I take this back
because the mean is undefined for df <= 1, the var also has to be undefined

@ev-br ev-br added defect A clear bug or issue that prevents SciPy from being installed or used as expected scipy.stats good first issue Good topic for first contributor pull requests, with a relatively straightforward solution labels Apr 30, 2018
@ev-br ev-br added this to the 1.2.0 milestone May 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defect A clear bug or issue that prevents SciPy from being installed or used as expected good first issue Good topic for first contributor pull requests, with a relatively straightforward solution scipy.stats
Projects
None yet
Development

No branches or pull requests

3 participants