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

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

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

Kevin Owens
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.
Reply | Threaded
Open this post in threaded view
|

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

John Myles White
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.

 -- John

On 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.