{"action":"created","issue":{"url":"https://api.github.com/repos/JuliaStats/Distributions.jl/issues/429","labels_url":"https://api.github.com/repos/JuliaStats/Distributions.jl/issues/429/labels{/name}","comments_url":"https://api.github.com/repos/JuliaStats/Distributions.jl/issues/429/comments","events_url":"https://api.github.com/repos/JuliaStats/Distributions.jl/issues/429/events","html_url":"https://github.com/JuliaStats/Distributions.jl/pull/429","id":112911110,"number":429,"title":"New Shifted distribution type","user":{"login":"slundberg","id":3740613,"avatar_url":"https://avatars.githubusercontent.com/u/3740613?v=3","gravatar_id":"","url":"https://api.github.com/users/slundberg","html_url":"https://github.com/slundberg","followers_url":"https://api.github.com/users/slundberg/followers","following_url":"https://api.github.com/users/slundberg/following{/other_user}","gists_url":"https://api.github.com/users/slundberg/gists{/gist_id}","starred_url":"https://api.github.com/users/slundberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slundberg/subscriptions","organizations_url":"https://api.github.com/users/slundberg/orgs","repos_url":"https://api.github.com/users/slundberg/repos","events_url":"https://api.github.com/users/slundberg/events{/privacy}","received_events_url":"https://api.github.com/users/slundberg/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-10-22T23:24:46Z","updated_at":"2015-10-26T15:36:30Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/JuliaStats/Distributions.jl/pulls/429","html_url":"https://github.com/JuliaStats/Distributions.jl/pull/429","diff_url":"https://github.com/JuliaStats/Distributions.jl/pull/429.diff","patch_url":"https://github.com/JuliaStats/Distributions.jl/pull/429.patch"},"body":"I ran into the need for this when working with mixture distributions. Sometimes a shifted distribution is needed when creating mixture distributions. For example:\r\n\r\n```julia\r\n# model where 10% of the time a constant is added to a Poisson\r\nMixtureModel([Poisson(4), Shifted(Poisson(4), 2)], [0.9,0.1])\r\n```"},"comment":{"url":"https://api.github.com/repos/JuliaStats/Distributions.jl/issues/comments/151177041","html_url":"https://github.com/JuliaStats/Distributions.jl/pull/429#issuecomment-151177041","issue_url":"https://api.github.com/repos/JuliaStats/Distributions.jl/issues/429","id":151177041,"user":{"login":"StefanKarpinski","id":153596,"avatar_url":"https://avatars.githubusercontent.com/u/153596?v=3","gravatar_id":"","url":"https://api.github.com/users/StefanKarpinski","html_url":"https://github.com/StefanKarpinski","followers_url":"https://api.github.com/users/StefanKarpinski/followers","following_url":"https://api.github.com/users/StefanKarpinski/following{/other_user}","gists_url":"https://api.github.com/users/StefanKarpinski/gists{/gist_id}","starred_url":"https://api.github.com/users/StefanKarpinski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StefanKarpinski/subscriptions","organizations_url":"https://api.github.com/users/StefanKarpinski/orgs","repos_url":"https://api.github.com/users/StefanKarpinski/repos","events_url":"https://api.github.com/users/StefanKarpinski/events{/privacy}","received_events_url":"https://api.github.com/users/StefanKarpinski/received_events","type":"User","site_admin":false},"created_at":"2015-10-26T15:36:30Z","updated_at":"2015-10-26T15:36:30Z","body":"Wouldn't the main thing to do here be provide special cases for `+` and `*` that construct, e.g. a new `Normal` with the right parameters when the distribution argument is `Normal`? Then the `Shifted` and `Scaled` constructions could be used as a generic fallback for distributions that aren't closed under shifting and/or scaling?"}}