{"action":"created","comment":{"url":"https://api.github.com/repos/scipy/scipy/pulls/comments/28201775","id":28201775,"diff_hunk":"@@ -20,3 +22,60 @@ def time_anderson_ksamp(self):\n         with warnings.catch_warnings():\n             warnings.simplefilter('ignore', UserWarning)\n             anderson_ksamp(self.rand)\n+\n+def random(size):\n+    return rand(*size)\n+\n+class CorrelationFunctions(Benchmark):\n+    param_names = ['alternative']\n+    params = [\n+        ['two-sided', 'less', 'greater']\n+    ]\n+\n+    def setup(self, mode):\n+        a = random([2,2])*10\n+        self.a = a\n+\n+    def time_fisher_exact(self, alternative):\n+        if alternative == 'two-sided':\n+            oddsratio, pvalue = fisher_exact(self.a, alternative='two-sided')\n+        elif alternative == 'less':\n+            oddsratio, pvalue = fisher_exact(self.a, alternative='less')\n+        else:\n+            oddsratio, pvalue = fisher_exact(self.a, alternative='greater')\n+\n+class InferentialStats(Benchmark):\n+\n+    def setup(self):\n+        np.random.seed(12345678)\n+        rvs1 = stats.norm.rvs(loc=5,scale=10,size=500)\n+        rvs2 = stats.norm.rvs(loc=5,scale=10,size=500)\n+        rvs3 = stats.norm.rvs(loc=5, scale=20, size=500)\n+        rvs4 = stats.norm.rvs(loc=5, scale=20, size=100)\n+        rvs5 = stats.norm.rvs(loc=8, scale=20, size=100)\n+        self.a = rvs1\n+        self.b = rvs2\n+        self.c = rvs3\n+        self.d = rvs4\n+        self.e = rvs5\n+\n+    def time_ttest_ind_same_mean(self):\n+        # test with sample with identical means:\n+        stats.ttest_ind(self.a, self.b)\n+        stats.ttest_ind(self.a, self.b, equal_var=False)\n+\n+    def time_ttest_ind_diff_var(self):\n+        # test with sample with unequal variances:\n+        stats.ttest_ind(self.a, self.c)\n+        stats.ttest_ind(self.a, self.c, equal_var=False)\n+\n+    def time_ttest_ind_diff_size(self):\n+        # test with sample with different sizes\n+        stats.ttest_ind(self.a, self.d)\n+        stats.ttest_ind(self.a, self.d, equal_var=False)\n+\n+    def time_ttest_ind_diff_all(self):","path":"benchmarks/benchmarks/stats.py","position":75,"original_position":75,"commit_id":"c6671de258b95c4317634b205ac3fa85a67a5d5d","original_commit_id":"c6671de258b95c4317634b205ac3fa85a67a5d5d","user":{"login":"rgommers","id":98330,"avatar_url":"https://avatars.githubusercontent.com/u/98330?v=3","gravatar_id":"","url":"https://api.github.com/users/rgommers","html_url":"https://github.com/rgommers","followers_url":"https://api.github.com/users/rgommers/followers","following_url":"https://api.github.com/users/rgommers/following{/other_user}","gists_url":"https://api.github.com/users/rgommers/gists{/gist_id}","starred_url":"https://api.github.com/users/rgommers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rgommers/subscriptions","organizations_url":"https://api.github.com/users/rgommers/orgs","repos_url":"https://api.github.com/users/rgommers/repos","events_url":"https://api.github.com/users/rgommers/events{/privacy}","received_events_url":"https://api.github.com/users/rgommers/received_events","type":"User","site_admin":false},"body":"this is probably one benchmark too many. I don't expect any difference between using ``loc=5`` and ``loc=8``.","created_at":"2015-04-12T08:33:20Z","updated_at":"2015-04-12T08:33:20Z","html_url":"https://github.com/scipy/scipy/pull/4714#discussion_r28201775","pull_request_url":"https://api.github.com/repos/scipy/scipy/pulls/4714","_links":{"self":{"href":"https://api.github.com/repos/scipy/scipy/pulls/comments/28201775"},"html":{"href":"https://github.com/scipy/scipy/pull/4714#discussion_r28201775"},"pull_request":{"href":"https://api.github.com/repos/scipy/scipy/pulls/4714"}}},"pull_request":{"url":"https://api.github.com/repos/scipy/scipy/pulls/4714","id":33111735,"html_url":"https://github.com/scipy/scipy/pull/4714","diff_url":"https://github.com/scipy/scipy/pull/4714.diff","patch_url":"https://github.com/scipy/scipy/pull/4714.patch","issue_url":"https://api.github.com/repos/scipy/scipy/issues/4714","number":4714,"state":"open","locked":false,"title":"BENCH: Add benchmarks for stats module","user":{"login":"maniteja123","id":6291963,"avatar_url":"https://avatars.githubusercontent.com/u/6291963?v=3","gravatar_id":"","url":"https://api.github.com/users/maniteja123","html_url":"https://github.com/maniteja123","followers_url":"https://api.github.com/users/maniteja123/followers","following_url":"https://api.github.com/users/maniteja123/following{/other_user}","gists_url":"https://api.github.com/users/maniteja123/gists{/gist_id}","starred_url":"https://api.github.com/users/maniteja123/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maniteja123/subscriptions","organizations_url":"https://api.github.com/users/maniteja123/orgs","repos_url":"https://api.github.com/users/maniteja123/repos","events_url":"https://api.github.com/users/maniteja123/events{/privacy}","received_events_url":"https://api.github.com/users/maniteja123/received_events","type":"User","site_admin":false},"body":"Add some benchmarks for stats package\r\n- [x] sample test for fischer_exact\r\n- [x] similar benchmarks for other functions like ttest_ind\r\n- [ ] also one distribution with its methods(pdf, cdf and fit being the most important), maybe cauchy, gamma or beta distribution.\r\n\r\n~~As of now, it is unable to run this file using ``python runtests.py --bench stats`` , which gives ``No benchmarks selected`` output. Any help appreciated.~~","created_at":"2015-04-11T23:18:43Z","updated_at":"2015-04-12T08:33:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"68429c9e8f513ef9e894fa54734d28caa6132238","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/scipy/scipy/pulls/4714/commits","review_comments_url":"https://api.github.com/repos/scipy/scipy/pulls/4714/comments","review_comment_url":"https://api.github.com/repos/scipy/scipy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/scipy/scipy/issues/4714/comments","statuses_url":"https://api.github.com/repos/scipy/scipy/statuses/c6671de258b95c4317634b205ac3fa85a67a5d5d","head":{"label":"maniteja123:stats-bench","ref":"stats-bench","sha":"c6671de258b95c4317634b205ac3fa85a67a5d5d","user":{"login":"maniteja123","id":6291963,"avatar_url":"https://avatars.githubusercontent.com/u/6291963?v=3","gravatar_id":"","url":"https://api.github.com/users/maniteja123","html_url":"https://github.com/maniteja123","followers_url":"https://api.github.com/users/maniteja123/followers","following_url":"https://api.github.com/users/maniteja123/following{/other_user}","gists_url":"https://api.github.com/users/maniteja123/gists{/gist_id}","starred_url":"https://api.github.com/users/maniteja123/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maniteja123/subscriptions","organizations_url":"https://api.github.com/users/maniteja123/orgs","repos_url":"https://api.github.com/users/maniteja123/repos","events_url":"https://api.github.com/users/maniteja123/events{/privacy}","received_events_url":"https://api.github.com/users/maniteja123/received_events","type":"User","site_admin":false},"repo":{"id":25398122,"name":"scipy","full_name":"maniteja123/scipy","owner":{"login":"maniteja123","id":6291963,"avatar_url":"https://avatars.githubusercontent.com/u/6291963?v=3","gravatar_id":"","url":"https://api.github.com/users/maniteja123","html_url":"https://github.com/maniteja123","followers_url":"https://api.github.com/users/maniteja123/followers","following_url":"https://api.github.com/users/maniteja123/following{/other_user}","gists_url":"https://api.github.com/users/maniteja123/gists{/gist_id}","starred_url":"https://api.github.com/users/maniteja123/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maniteja123/subscriptions","organizations_url":"https://api.github.com/users/maniteja123/orgs","repos_url":"https://api.github.com/users/maniteja123/repos","events_url":"https://api.github.com/users/maniteja123/events{/privacy}","received_events_url":"https://api.github.com/users/maniteja123/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/maniteja123/scipy","description":"Scipy library main repository","fork":true,"url":"https://api.github.com/repos/maniteja123/scipy","forks_url":"https://api.github.com/repos/maniteja123/scipy/forks","keys_url":"https://api.github.com/repos/maniteja123/scipy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/maniteja123/scipy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/maniteja123/scipy/teams","hooks_url":"https://api.github.com/repos/maniteja123/scipy/hooks","issue_events_url":"https://api.github.com/repos/maniteja123/scipy/issues/events{/number}","events_url":"https://api.github.com/repos/maniteja123/scipy/events","assignees_url":"https://api.github.com/repos/maniteja123/scipy/assignees{/user}","branches_url":"https://api.github.com/repos/maniteja123/scipy/branches{/branch}","tags_url":"https://api.github.com/repos/maniteja123/scipy/tags","blobs_url":"https://api.github.com/repos/maniteja123/scipy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/maniteja123/scipy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/maniteja123/scipy/git/refs{/sha}","trees_url":"https://api.github.com/repos/maniteja123/scipy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/maniteja123/scipy/statuses/{sha}","languages_url":"https://api.github.com/repos/maniteja123/scipy/languages","stargazers_url":"https://api.github.com/repos/maniteja123/scipy/stargazers","contributors_url":"https://api.github.com/repos/maniteja123/scipy/contributors","subscribers_url":"https://api.github.com/repos/maniteja123/scipy/subscribers","subscription_url":"https://api.github.com/repos/maniteja123/scipy/subscription","commits_url":"https://api.github.com/repos/maniteja123/scipy/commits{/sha}","git_commits_url":"https://api.github.com/repos/maniteja123/scipy/git/commits{/sha}","comments_url":"https://api.github.com/repos/maniteja123/scipy/comments{/number}","issue_comment_url":"https://api.github.com/repos/maniteja123/scipy/issues/comments{/number}","contents_url":"https://api.github.com/repos/maniteja123/scipy/contents/{+path}","compare_url":"https://api.github.com/repos/maniteja123/scipy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/maniteja123/scipy/merges","archive_url":"https://api.github.com/repos/maniteja123/scipy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/maniteja123/scipy/downloads","issues_url":"https://api.github.com/repos/maniteja123/scipy/issues{/number}","pulls_url":"https://api.github.com/repos/maniteja123/scipy/pulls{/number}","milestones_url":"https://api.github.com/repos/maniteja123/scipy/milestones{/number}","notifications_url":"https://api.github.com/repos/maniteja123/scipy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/maniteja123/scipy/labels{/name}","releases_url":"https://api.github.com/repos/maniteja123/scipy/releases{/id}","created_at":"2014-10-18T13:31:08Z","updated_at":"2015-04-12T02:01:10Z","pushed_at":"2015-04-12T06:14:19Z","git_url":"git://github.com/maniteja123/scipy.git","ssh_url":"git@github.com:maniteja123/scipy.git","clone_url":"https://github.com/maniteja123/scipy.git","svn_url":"https://github.com/maniteja123/scipy","homepage":"http://scipy.org/scipylib/","size":54936,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"scipy:master","ref":"master","sha":"b4652f5de479715fde0d3e7e70c18bd27ee47859","user":{"login":"scipy","id":288277,"avatar_url":"https://avatars.githubusercontent.com/u/288277?v=3","gravatar_id":"","url":"https://api.github.com/users/scipy","html_url":"https://github.com/scipy","followers_url":"https://api.github.com/users/scipy/followers","following_url":"https://api.github.com/users/scipy/following{/other_user}","gists_url":"https://api.github.com/users/scipy/gists{/gist_id}","starred_url":"https://api.github.com/users/scipy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scipy/subscriptions","organizations_url":"https://api.github.com/users/scipy/orgs","repos_url":"https://api.github.com/users/scipy/repos","events_url":"https://api.github.com/users/scipy/events{/privacy}","received_events_url":"https://api.github.com/users/scipy/received_events","type":"Organization","site_admin":false},"repo":{"id":1460385,"name":"scipy","full_name":"scipy/scipy","owner":{"login":"scipy","id":288277,"avatar_url":"https://avatars.githubusercontent.com/u/288277?v=3","gravatar_id":"","url":"https://api.github.com/users/scipy","html_url":"https://github.com/scipy","followers_url":"https://api.github.com/users/scipy/followers","following_url":"https://api.github.com/users/scipy/following{/other_user}","gists_url":"https://api.github.com/users/scipy/gists{/gist_id}","starred_url":"https://api.github.com/users/scipy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scipy/subscriptions","organizations_url":"https://api.github.com/users/scipy/orgs","repos_url":"https://api.github.com/users/scipy/repos","events_url":"https://api.github.com/users/scipy/events{/privacy}","received_events_url":"https://api.github.com/users/scipy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/scipy/scipy","description":"Scipy library main repository","fork":false,"url":"https://api.github.com/repos/scipy/scipy","forks_url":"https://api.github.com/repos/scipy/scipy/forks","keys_url":"https://api.github.com/repos/scipy/scipy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/scipy/scipy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/scipy/scipy/teams","hooks_url":"https://api.github.com/repos/scipy/scipy/hooks","issue_events_url":"https://api.github.com/repos/scipy/scipy/issues/events{/number}","events_url":"https://api.github.com/repos/scipy/scipy/events","assignees_url":"https://api.github.com/repos/scipy/scipy/assignees{/user}","branches_url":"https://api.github.com/repos/scipy/scipy/branches{/branch}","tags_url":"https://api.github.com/repos/scipy/scipy/tags","blobs_url":"https://api.github.com/repos/scipy/scipy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/scipy/scipy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/scipy/scipy/git/refs{/sha}","trees_url":"https://api.github.com/repos/scipy/scipy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/scipy/scipy/statuses/{sha}","languages_url":"https://api.github.com/repos/scipy/scipy/languages","stargazers_url":"https://api.github.com/repos/scipy/scipy/stargazers","contributors_url":"https://api.github.com/repos/scipy/scipy/contributors","subscribers_url":"https://api.github.com/repos/scipy/scipy/subscribers","subscription_url":"https://api.github.com/repos/scipy/scipy/subscription","commits_url":"https://api.github.com/repos/scipy/scipy/commits{/sha}","git_commits_url":"https://api.github.com/repos/scipy/scipy/git/commits{/sha}","comments_url":"https://api.github.com/repos/scipy/scipy/comments{/number}","issue_comment_url":"https://api.github.com/repos/scipy/scipy/issues/comments{/number}","contents_url":"https://api.github.com/repos/scipy/scipy/contents/{+path}","compare_url":"https://api.github.com/repos/scipy/scipy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/scipy/scipy/merges","archive_url":"https://api.github.com/repos/scipy/scipy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/scipy/scipy/downloads","issues_url":"https://api.github.com/repos/scipy/scipy/issues{/number}","pulls_url":"https://api.github.com/repos/scipy/scipy/pulls{/number}","milestones_url":"https://api.github.com/repos/scipy/scipy/milestones{/number}","notifications_url":"https://api.github.com/repos/scipy/scipy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/scipy/scipy/labels{/name}","releases_url":"https://api.github.com/repos/scipy/scipy/releases{/id}","created_at":"2011-03-09T18:52:03Z","updated_at":"2015-04-12T07:26:42Z","pushed_at":"2015-04-12T07:48:33Z","git_url":"git://github.com/scipy/scipy.git","ssh_url":"git@github.com:scipy/scipy.git","clone_url":"https://github.com/scipy/scipy.git","svn_url":"https://github.com/scipy/scipy","homepage":"http://scipy.org/scipylib/","size":86236,"stargazers_count":1582,"watchers_count":1582,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":853,"mirror_url":null,"open_issues_count":799,"forks":853,"open_issues":799,"watchers":1582,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/scipy/scipy/pulls/4714"},"html":{"href":"https://github.com/scipy/scipy/pull/4714"},"issue":{"href":"https://api.github.com/repos/scipy/scipy/issues/4714"},"comments":{"href":"https://api.github.com/repos/scipy/scipy/issues/4714/comments"},"review_comments":{"href":"https://api.github.com/repos/scipy/scipy/pulls/4714/comments"},"review_comment":{"href":"https://api.github.com/repos/scipy/scipy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/scipy/scipy/pulls/4714/commits"},"statuses":{"href":"https://api.github.com/repos/scipy/scipy/statuses/c6671de258b95c4317634b205ac3fa85a67a5d5d"}}}}