{"action":"closed","issue":{"url":"https://api.github.com/repos/scipy/scipy/issues/4752","labels_url":"https://api.github.com/repos/scipy/scipy/issues/4752/labels{/name}","comments_url":"https://api.github.com/repos/scipy/scipy/issues/4752/comments","events_url":"https://api.github.com/repos/scipy/scipy/issues/4752/events","html_url":"https://github.com/scipy/scipy/issues/4752","id":69066415,"number":4752,"title":"scipy stats fit behaves questionably for distributions with bounded support","user":{"login":"argriffing","id":101416,"avatar_url":"https://avatars.githubusercontent.com/u/101416?v=3","gravatar_id":"","url":"https://api.github.com/users/argriffing","html_url":"https://github.com/argriffing","followers_url":"https://api.github.com/users/argriffing/followers","following_url":"https://api.github.com/users/argriffing/following{/other_user}","gists_url":"https://api.github.com/users/argriffing/gists{/gist_id}","starred_url":"https://api.github.com/users/argriffing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/argriffing/subscriptions","organizations_url":"https://api.github.com/users/argriffing/orgs","repos_url":"https://api.github.com/users/argriffing/repos","events_url":"https://api.github.com/users/argriffing/events{/privacy}","received_events_url":"https://api.github.com/users/argriffing/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/scipy/scipy/labels/scipy.stats","name":"scipy.stats","color":"207de5"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-04-17T05:30:10Z","updated_at":"2015-04-27T15:12:44Z","closed_at":"2015-04-27T15:12:44Z","body":"I think it could be possible to find initial location and scale guesses automatically so that the initial support includes all of the data.  Given the initial shape parameters (default 1.0), I think you can already get the lower and upper bounds of the support (called `a` and `b`) for the default location and scale parameters 0 and 1.  Given `a` and `b`, you could pick initial location and scale parameter values such that the initial support covers all of the data points.  This would be an alternative to the current strategy of picking the initial location and scale parameters so that the mean and variance of the distribution match the mean and variance of the data.\r\n\r\nThere have been a few discussions about this problem in the past, but just as a concrete example here's a data array that causes problems for several distributions that have bounded support.\r\n```python\r\n>>> import numpy as np\r\n>>> from scipy.stats import uniform\r\n>>> data = [1.01, 1.78, 1.78, 1.78, 1.88, 1.88, 1.88, 2.00]\r\n>>> uniform.fit_loc_scale(data)\r\n(1.249943612210108, 0.99761277557978356)\r\n>>> uniform.fit(data)\r\n(1.7799948270442498, 0.2200056439937767)\r\n>>> \r\n```"}}