# preferred method of creating scaled and shifted distributions in Distributions.jl?

2 messages
Open this post in threaded view
|

## preferred method of creating scaled and shifted distributions in Distributions.jl?

 If the distribution has a support over real numbers then scaling/shifting is easy enough, but if it doesn't, is there an elegant way to create scaled and shifted distributions? The only way I could think of doing it would involve writing new methods for each quantity I wanted, which seems tedious.For example, if I wanted a Beta distribution with a=1, b=1 over the support [1,3], I was hoping I could write`my_beta = 2*Beta(1,1)+1`But that results in an error. Of course, if I wanted a sample from that distribution I could make a new function:`my_sampler(n) = 2*rand(Beta(1,1),n) + 1`Is there any interest in adding that kind of functionality to Distributions.jl? Instead of refactoring the standard distribution, maybe new distribution types could be added, e.g. ScaledShiftedBeta, and then write appropriate methods. -- You received this message because you are subscribed to the Google Groups "julia-stats" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. For more options, visit https://groups.google.com/d/optout.
Open this post in threaded view
|

## Re: preferred method of creating scaled and shifted distributions in Distributions.jl?

 There are a few issues about adding location/scale families to Distributions.jl. Would be great if you took up the draft work that already exists and finished it. -- JohnOn Jul 3, 2015, at 3:28 PM, Kevin Owens <[hidden email]> wrote:If the distribution has a support over real numbers then scaling/shifting is easy enough, but if it doesn't, is there an elegant way to create scaled and shifted distributions? The only way I could think of doing it would involve writing new methods for each quantity I wanted, which seems tedious.For example, if I wanted a Beta distribution with a=1, b=1 over the support [1,3], I was hoping I could write`my_beta = 2*Beta(1,1)+1`But that results in an error. Of course, if I wanted a sample from that distribution I could make a new function:`my_sampler(n) = 2*rand(Beta(1,1),n) + 1`Is there any interest in adding that kind of functionality to Distributions.jl? Instead of refactoring the standard distribution, maybe new distribution types could be added, e.g. ScaledShiftedBeta, and then write appropriate methods. -- You received this message because you are subscribed to the Google Groups "julia-stats" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "julia-stats" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. For more options, visit https://groups.google.com/d/optout.