I have a question about how to structure certain types. Even though the application is statistics, the question is really about types.

I’d like to build types that take a Distribution (from the Distributions package) and transform it into another Distribution. I’d like this to maintain the VariateForm of the Distribution. Below is a simplified version of what I’d like. Is there a way to do this which works?

using Distributions

type Translation{S,T<:UnivariateDistribution{S}} <: UnivariateDistribution{S}

distribution::T

translation::Float64

scale::Float64

end

Translation( distribution::UnivariateDistribution, x::Float64 ) =

Translation( distribution, x, 1/x )

t = Translation( Normal(), 2.0 )