{"action":"created","issue":{"url":"https://api.github.com/repos/piklprado/sads/issues/35","labels_url":"https://api.github.com/repos/piklprado/sads/issues/35/labels{/name}","comments_url":"https://api.github.com/repos/piklprado/sads/issues/35/comments","events_url":"https://api.github.com/repos/piklprado/sads/issues/35/events","html_url":"https://github.com/piklprado/sads/issues/35","id":71425802,"number":35,"title":"Replace bisection in [q] functions","user":{"login":"andrechalom","id":1994997,"avatar_url":"https://avatars.githubusercontent.com/u/1994997?v=3","gravatar_id":"","url":"https://api.github.com/users/andrechalom","html_url":"https://github.com/andrechalom","followers_url":"https://api.github.com/users/andrechalom/followers","following_url":"https://api.github.com/users/andrechalom/following{/other_user}","gists_url":"https://api.github.com/users/andrechalom/gists{/gist_id}","starred_url":"https://api.github.com/users/andrechalom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrechalom/subscriptions","organizations_url":"https://api.github.com/users/andrechalom/orgs","repos_url":"https://api.github.com/users/andrechalom/repos","events_url":"https://api.github.com/users/andrechalom/events{/privacy}","received_events_url":"https://api.github.com/users/andrechalom/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/piklprado/sads/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/piklprado/sads/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-04-27T23:06:27Z","updated_at":"2015-04-28T15:58:29Z","closed_at":null,"body":"The method used to find quantiles for discrete probability functions (qbs, qls, qpoilog, qpower, plus qpoix and qpoig) in the current release is the search by bisection. This method has three issues:\r\n- A lot of duplicated code is found on this functions\r\n- The method is generally inefficient, as it converges linearly (other methods may converge quadratically)\r\n- The current implementation hangs if the p is very close to 1:\r\n```R\r\n> qpoilog(0.9999999, 1,1) ## HANGS\r\n```\r\n\r\nMaybe this code can be substituted by uniroot calls?"},"comment":{"url":"https://api.github.com/repos/piklprado/sads/issues/comments/97117627","html_url":"https://github.com/piklprado/sads/issues/35#issuecomment-97117627","issue_url":"https://api.github.com/repos/piklprado/sads/issues/35","id":97117627,"user":{"login":"andrechalom","id":1994997,"avatar_url":"https://avatars.githubusercontent.com/u/1994997?v=3","gravatar_id":"","url":"https://api.github.com/users/andrechalom","html_url":"https://github.com/andrechalom","followers_url":"https://api.github.com/users/andrechalom/followers","following_url":"https://api.github.com/users/andrechalom/following{/other_user}","gists_url":"https://api.github.com/users/andrechalom/gists{/gist_id}","starred_url":"https://api.github.com/users/andrechalom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrechalom/subscriptions","organizations_url":"https://api.github.com/users/andrechalom/orgs","repos_url":"https://api.github.com/users/andrechalom/repos","events_url":"https://api.github.com/users/andrechalom/events{/privacy}","received_events_url":"https://api.github.com/users/andrechalom/received_events","type":"User","site_admin":false},"created_at":"2015-04-28T15:58:29Z","updated_at":"2015-04-28T15:58:29Z","body":"A small comparison of the new qpoilog _versus_ the original qpoilog.orig performances:\r\n\r\n```R\r\n> p <- 0:20/20\r\n> qpoilog(p, 1, 1)\r\n [1]   0   0   0   0   1   1   1   2   2   2   3   3   4   4   5   6   7   8  10  15 Inf\r\n> microbenchmark(qpoilog(p, 1, 1), qpoilog.orig(p, 1, 1))\r\nUnit: milliseconds\r\n                  expr       min        lq      mean    median        uq       max neval cld\r\n      qpoilog(p, 1, 1)  6.328103  6.454206  6.642205  6.575216  6.661761  7.869904   100  a \r\n qpoilog.orig(p, 1, 1) 36.764368 58.563975 66.690892 66.372270 75.559158 96.157810   100   b\r\n```"}}