{"action":"created","issue":{"url":"https://api.github.com/repos/piLaboratory/sads/issues/119","repository_url":"https://api.github.com/repos/piLaboratory/sads","labels_url":"https://api.github.com/repos/piLaboratory/sads/issues/119/labels{/name}","comments_url":"https://api.github.com/repos/piLaboratory/sads/issues/119/comments","events_url":"https://api.github.com/repos/piLaboratory/sads/issues/119/events","html_url":"https://github.com/piLaboratory/sads/issues/119","id":132567696,"number":119,"title":"dzmsm returns probabilties for non-integers","user":{"login":"piklprado","id":6313365,"avatar_url":"https://avatars.githubusercontent.com/u/6313365?v=3","gravatar_id":"","url":"https://api.github.com/users/piklprado","html_url":"https://github.com/piklprado","followers_url":"https://api.github.com/users/piklprado/followers","following_url":"https://api.github.com/users/piklprado/following{/other_user}","gists_url":"https://api.github.com/users/piklprado/gists{/gist_id}","starred_url":"https://api.github.com/users/piklprado/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/piklprado/subscriptions","organizations_url":"https://api.github.com/users/piklprado/orgs","repos_url":"https://api.github.com/users/piklprado/repos","events_url":"https://api.github.com/users/piklprado/events{/privacy}","received_events_url":"https://api.github.com/users/piklprado/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/piLaboratory/sads/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/piLaboratory/sads/milestones/2","html_url":"https://github.com/piLaboratory/sads/milestones/sads%200.3.0","labels_url":"https://api.github.com/repos/piLaboratory/sads/milestones/2/labels","id":1162899,"number":2,"title":"sads 0.3.0","description":"Improvements tagged for the next major upgrade of the package.","creator":{"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},"open_issues":5,"closed_issues":14,"state":"open","created_at":"2015-06-13T02:02:07Z","updated_at":"2016-02-09T23:56:09Z","due_on":"2015-12-31T02:00:00Z","closed_at":null},"comments":0,"created_at":"2016-02-09T23:29:42Z","updated_at":"2016-02-11T16:23:18Z","closed_at":null,"body":"The regional metacommunity zero-sum multinomial is a discrete distribution, but the function `dzsm` currently returns values to no non-integers to\r\n\r\n```r\r\n> distr(\"mzsm\")\r\n[1] \"discrete\"\r\n> dmzsm(c(1,1.1), 1000, 20)\r\n[1] 0.2486041 0.2255743\r\n```\r\n\r\nSo we have to make [dpq]zsm comply with the standard behavior of discrete probability functions in R, which is to return zero for non-integers\r\n\r\n```r\r\n> dpois(c(1,1.1), lambda=1)\r\n[1] 0.3678794 0.0000000\r\nWarning message:\r\nIn dpois(c(1, 1.1), lambda = 1) : non-integer x = 1.100000\r\n```\r\nIt is already implemented for the other discrete distributions in sads."},"comment":{"url":"https://api.github.com/repos/piLaboratory/sads/issues/comments/182941953","html_url":"https://github.com/piLaboratory/sads/issues/119#issuecomment-182941953","issue_url":"https://api.github.com/repos/piLaboratory/sads/issues/119","id":182941953,"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":"2016-02-11T16:23:18Z","updated_at":"2016-02-11T16:23:18Z","body":"[q] functions are not affected. pmzsm already checks for non-integer values. \r\n\r\nFixed dmzsm and pushed it directly to dev branch, as the change is really minor.\r\n\r\nChecking the code for all discrete distributions: [dp]gs, [dp]rbs, [dp]power, [dp]powbend, [dp]poilog, [dp]mand, [dp]ls, [dp]volkov and [dp]zipf all comply."}}