Skip to content

Commit

Permalink
Fix most depwarn/error on 0.6 (#577)
Browse files Browse the repository at this point in the history
  • Loading branch information
yuyichao authored and andreasnoack committed Feb 14, 2017
1 parent 06a7544 commit f4535a6
Show file tree
Hide file tree
Showing 65 changed files with 184 additions and 184 deletions.
2 changes: 1 addition & 1 deletion REQUIRE
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ PDMats 0.5.4
StatsFuns 0.3.1
Calculus
StatsBase 0.8.3
Compat 0.17.0
Compat 0.18.0
QuadGK 0.1.1
SpecialFunctions 0.1.0
4 changes: 2 additions & 2 deletions doc/source/mixture.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ This package introduces a type ``MixtureModel``, defined as follows, to represen
prior::Categorical
end
typealias UnivariateMixture AbstractMixtureModel{Univariate}
typealias MultivariateMixture AbstractMixtureModel{Multivariate}
const UnivariateMixture = AbstractMixtureModel{Univariate}
const MultivariateMixture = AbstractMixtureModel{Multivariate}
**Remarks:**

Expand Down
30 changes: 15 additions & 15 deletions doc/source/multivariate.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ Multivariate Distributions

.. code-block:: julia
typealias MultivariateDistribution{S<:ValueSupport} Distribution{Multivariate,S}
const MultivariateDistribution{S<:ValueSupport} = Distribution{Multivariate,S}
typealias DiscreteMultivariateDistribution Distribution{Multivariate, Discrete}
typealias ContinuousMultivariateDistribution Distribution{Multivariate, Continuous}
const DiscreteMultivariateDistribution = Distribution{Multivariate, Discrete}
const ContinuousMultivariateDistribution = Distribution{Multivariate, Continuous}
Common Interface
Expand Down Expand Up @@ -155,13 +155,13 @@ We also define a set of alias for the types using different combinations of mean

.. code-block:: julia
typealias IsoNormal MvNormal{ScalMat, Vector{Float64}}
typealias DiagNormal MvNormal{PDiagMat, Vector{Float64}}
typealias FullNormal MvNormal{PDMat, Vector{Float64}}
const IsoNormal = MvNormal{ScalMat, Vector{Float64}}
const DiagNormal = MvNormal{PDiagMat, Vector{Float64}}
const FullNormal = MvNormal{PDMat, Vector{Float64}}
typealias ZeroMeanIsoNormal MvNormal{ScalMat, ZeroVector{Float64}}
typealias ZeroMeanDiagNormal MvNormal{PDiagMat, ZeroVector{Float64}}
typealias ZeroMeanFullNormal MvNormal{PDMat, ZeroVector{Float64}}
const ZeroMeanIsoNormal = MvNormal{ScalMat, ZeroVector{Float64}}
const ZeroMeanDiagNormal = MvNormal{PDiagMat, ZeroVector{Float64}}
const ZeroMeanFullNormal = MvNormal{PDMat, ZeroVector{Float64}}
Construction
Expand Down Expand Up @@ -247,13 +247,13 @@ We also define aliases for common specializations of this parametric type:

.. code:: julia
typealias FullNormalCanon MvNormalCanon{PDMat, Vector{Float64}}
typealias DiagNormalCanon MvNormalCanon{PDiagMat, Vector{Float64}}
typealias IsoNormalCanon MvNormalCanon{ScalMat, Vector{Float64}}
const FullNormalCanon = MvNormalCanon{PDMat, Vector{Float64}}
const DiagNormalCanon = MvNormalCanon{PDiagMat, Vector{Float64}}
const IsoNormalCanon = MvNormalCanon{ScalMat, Vector{Float64}}
typealias ZeroMeanFullNormalCanon MvNormalCanon{PDMat, ZeroVector{Float64}}
typealias ZeroMeanDiagNormalCanon MvNormalCanon{PDiagMat, ZeroVector{Float64}}
typealias ZeroMeanIsoNormalCanon MvNormalCanon{ScalMat, ZeroVector{Float64}}
const ZeroMeanFullNormalCanon = MvNormalCanon{PDMat, ZeroVector{Float64}}
const ZeroMeanDiagNormalCanon = MvNormalCanon{PDiagMat, ZeroVector{Float64}}
const ZeroMeanIsoNormalCanon = MvNormalCanon{ScalMat, ZeroVector{Float64}}
A multivariate distribution with canonical parameterization can be constructed using a common constructor ``MvNormalCanon`` as:

Expand Down
28 changes: 14 additions & 14 deletions doc/source/types.rst
Original file line number Diff line number Diff line change
Expand Up @@ -103,20 +103,20 @@ To simplify the use in practice, we introduce a series of type alias as follows:

.. code-block:: julia
typealias UnivariateDistribution{S<:ValueSupport} Distribution{Univariate,S}
typealias MultivariateDistribution{S<:ValueSupport} Distribution{Multivariate,S}
typealias MatrixDistribution{S<:ValueSupport} Distribution{Matrixvariate,S}
typealias NonMatrixDistribution Union{UnivariateDistribution, MultivariateDistribution}
typealias DiscreteDistribution{F<:VariateForm} Distribution{F,Discrete}
typealias ContinuousDistribution{F<:VariateForm} Distribution{F,Continuous}
typealias DiscreteUnivariateDistribution Distribution{Univariate, Discrete}
typealias ContinuousUnivariateDistribution Distribution{Univariate, Continuous}
typealias DiscreteMultivariateDistribution Distribution{Multivariate, Discrete}
typealias ContinuousMultivariateDistribution Distribution{Multivariate, Continuous}
typealias DiscreteMatrixDistribution Distribution{Matrixvariate, Discrete}
typealias ContinuousMatrixDistribution Distribution{Matrixvariate, Continuous}
const UnivariateDistribution{S<:ValueSupport} = Distribution{Univariate,S}
const MultivariateDistribution{S<:ValueSupport} = Distribution{Multivariate,S}
const MatrixDistribution{S<:ValueSupport} = Distribution{Matrixvariate,S}
const NonMatrixDistribution = Union{UnivariateDistribution, MultivariateDistribution}
const DiscreteDistribution{F<:VariateForm} = Distribution{F,Discrete}
const ContinuousDistribution{F<:VariateForm} = Distribution{F,Continuous}
const DiscreteUnivariateDistribution = Distribution{Univariate, Discrete}
const ContinuousUnivariateDistribution = Distribution{Univariate, Continuous}
const DiscreteMultivariateDistribution = Distribution{Multivariate, Discrete}
const ContinuousMultivariateDistribution = Distribution{Multivariate, Continuous}
const DiscreteMatrixDistribution = Distribution{Matrixvariate, Discrete}
const ContinuousMatrixDistribution = Distribution{Matrixvariate, Continuous}
All methods applicable to `Sampleable` also applies to `Distribution`. The API for distributions of different variate forms are different (refer to :ref:`univariates`, :ref:`multivariates`, and :ref:`matrix` for details).

Expand Down
6 changes: 3 additions & 3 deletions doc/source/univariate.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ Univariate Distributions

.. code-block:: julia
typealias UnivariateDistribution{S<:ValueSupport} Distribution{Univariate,S}
const UnivariateDistribution{S<:ValueSupport} = Distribution{Univariate,S}
typealias DiscreteUnivariateDistribution Distribution{Univariate, Discrete}
typealias ContinuousUnivariateDistribution Distribution{Univariate, Continuous}
const DiscreteUnivariateDistribution = Distribution{Univariate, Discrete}
const ContinuousUnivariateDistribution = Distribution{Univariate, Continuous}
Common Interface
Expand Down
28 changes: 14 additions & 14 deletions src/common.jl
Original file line number Diff line number Diff line change
Expand Up @@ -38,20 +38,20 @@ nsamples{D<:Sampleable{Matrixvariate},T<:Number}(::Type{D}, x::Array{Matrix{T}})

@compat abstract type Distribution{F<:VariateForm,S<:ValueSupport} <: Sampleable{F,S} end

typealias UnivariateDistribution{S<:ValueSupport} Distribution{Univariate,S}
typealias MultivariateDistribution{S<:ValueSupport} Distribution{Multivariate,S}
typealias MatrixDistribution{S<:ValueSupport} Distribution{Matrixvariate,S}
typealias NonMatrixDistribution Union{UnivariateDistribution, MultivariateDistribution}
@compat const UnivariateDistribution{S<:ValueSupport} = Distribution{Univariate,S}
@compat const MultivariateDistribution{S<:ValueSupport} = Distribution{Multivariate,S}
@compat const MatrixDistribution{S<:ValueSupport} = Distribution{Matrixvariate,S}
const NonMatrixDistribution = Union{UnivariateDistribution, MultivariateDistribution}

typealias DiscreteDistribution{F<:VariateForm} Distribution{F,Discrete}
typealias ContinuousDistribution{F<:VariateForm} Distribution{F,Continuous}
@compat const DiscreteDistribution{F<:VariateForm} = Distribution{F,Discrete}
@compat const ContinuousDistribution{F<:VariateForm} = Distribution{F,Continuous}

typealias DiscreteUnivariateDistribution Distribution{Univariate, Discrete}
typealias ContinuousUnivariateDistribution Distribution{Univariate, Continuous}
typealias DiscreteMultivariateDistribution Distribution{Multivariate, Discrete}
typealias ContinuousMultivariateDistribution Distribution{Multivariate, Continuous}
typealias DiscreteMatrixDistribution Distribution{Matrixvariate, Discrete}
typealias ContinuousMatrixDistribution Distribution{Matrixvariate, Continuous}
const DiscreteUnivariateDistribution = Distribution{Univariate, Discrete}
const ContinuousUnivariateDistribution = Distribution{Univariate, Continuous}
const DiscreteMultivariateDistribution = Distribution{Multivariate, Discrete}
const ContinuousMultivariateDistribution = Distribution{Multivariate, Continuous}
const DiscreteMatrixDistribution = Distribution{Matrixvariate, Discrete}
const ContinuousMatrixDistribution = Distribution{Matrixvariate, Continuous}

variate_form{VF<:VariateForm,VS<:ValueSupport}(::Type{Distribution{VF,VS}}) = VF
variate_form{T<:Distribution}(::Type{T}) = variate_form(supertype(T))
Expand All @@ -63,5 +63,5 @@ value_support{T<:Distribution}(::Type{T}) = value_support(supertype(T))
@compat abstract type SufficientStats end
@compat abstract type IncompleteDistribution end

typealias DistributionType{D<:Distribution} Type{D}
typealias IncompleteFormulation Union{DistributionType,IncompleteDistribution}
@compat const DistributionType{D<:Distribution} = Type{D}
const IncompleteFormulation = Union{DistributionType,IncompleteDistribution}
12 changes: 6 additions & 6 deletions src/edgeworth.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ immutable EdgeworthZ{D<:UnivariateDistribution} <: EdgeworthAbstract
dist::D
n::Float64

function EdgeworthZ{T<:UnivariateDistribution}(d::T, n::Real)
function (::Type{EdgeworthZ{D}}){D<:UnivariateDistribution,T<:UnivariateDistribution}(d::T, n::Real)
@check_args(EdgeworthZ, n > zero(n))
new(d, n)
new{D}(d, n)
end
end
EdgeworthZ(d::UnivariateDistribution,n::Real) = EdgeworthZ{typeof(d)}(d,n)
Expand Down Expand Up @@ -77,9 +77,9 @@ end
immutable EdgeworthSum{D<:UnivariateDistribution} <: EdgeworthAbstract
dist::D
n::Float64
function EdgeworthSum{T<:UnivariateDistribution}(d::T, n::Real)
function (::Type{EdgeworthSum{D}}){D<:UnivariateDistribution,T<:UnivariateDistribution}(d::T, n::Real)
@check_args(EdgeworthSum, n > zero(n))
new(d, n)
new{D}(d, n)
end
end
EdgeworthSum(d::UnivariateDistribution, n::Real) = EdgeworthSum{typeof(d)}(d,n)
Expand All @@ -91,11 +91,11 @@ var(d::EdgeworthSum) = d.n*var(d.dist)
immutable EdgeworthMean{D<:UnivariateDistribution} <: EdgeworthAbstract
dist::D
n::Float64
function EdgeworthMean{T<:UnivariateDistribution}(d::T, n::Real)
function (::Type{EdgeworthMean{D}}){D<:UnivariateDistribution,T<:UnivariateDistribution}(d::T, n::Real)
# although n would usually be an integer, no methods are require this
n > zero(n) ||
error("n must be positive")
new(d, Float64(n))
new{D}(d, Float64(n))
end
end
EdgeworthMean(d::UnivariateDistribution,n::Real) = EdgeworthMean{typeof(d)}(d,n)
Expand Down
10 changes: 5 additions & 5 deletions src/mixtures/mixturemodel.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@ immutable MixtureModel{VF<:VariateForm,VS<:ValueSupport,C<:Distribution} <: Abst
components::Vector{C}
prior::Categorical

function MixtureModel(cs::Vector{C}, pri::Categorical)
function (::Type{MixtureModel{VF,VS,C}}){VF,VS,C}(cs::Vector{C}, pri::Categorical)
length(cs) == ncategories(pri) ||
error("The number of components does not match the length of prior.")
new(cs, pri)
new{VF,VS,C}(cs, pri)
end
end

typealias UnivariateMixture{S<:ValueSupport, C<:Distribution} AbstractMixtureModel{Univariate,S,C}
typealias MultivariateMixture{S<:ValueSupport, C<:Distribution} AbstractMixtureModel{Multivariate,S,C}
typealias MatrixvariateMixture{S<:ValueSupport,C<:Distribution} AbstractMixtureModel{Matrixvariate,S,C}
@compat const UnivariateMixture{S<:ValueSupport, C<:Distribution} = AbstractMixtureModel{Univariate,S,C}
@compat const MultivariateMixture{S<:ValueSupport, C<:Distribution} = AbstractMixtureModel{Multivariate,S,C}
@compat const MatrixvariateMixture{S<:ValueSupport,C<:Distribution} = AbstractMixtureModel{Matrixvariate,S,C}

component_type{VF,VS,C}(d::AbstractMixtureModel{VF,VS,C}) = C

Expand Down
8 changes: 4 additions & 4 deletions src/multivariate/dirichlet.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ immutable Dirichlet{T<:Real} <: ContinuousMultivariateDistribution
alpha0::T
lmnB::T

function Dirichlet(alpha::Vector{T})
function (::Type{Dirichlet{T}}){T}(alpha::Vector{T})
alpha0::T = zero(T)
lmnB::T = zero(T)
for i in 1:length(alpha)
Expand All @@ -13,12 +13,12 @@ immutable Dirichlet{T<:Real} <: ContinuousMultivariateDistribution
lmnB += lgamma(ai)
end
lmnB -= lgamma(alpha0)
new(alpha, alpha0, lmnB)
new{T}(alpha, alpha0, lmnB)
end

function Dirichlet(d::Integer, alpha::T)
function (::Type{Dirichlet{T}}){T}(d::Integer, alpha::T)
alpha0 = alpha * d
new(fill(alpha, d), alpha0, lgamma(alpha) * d - lgamma(alpha0))
new{T}(fill(alpha, d), alpha0, lgamma(alpha) * d - lgamma(alpha0))
end
end

Expand Down
4 changes: 2 additions & 2 deletions src/multivariate/dirichletmultinomial.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ immutable DirichletMultinomial{T <: Real} <: DiscreteMultivariateDistribution
α::Vector{T}
α0::T

function DirichletMultinomial(n::Integer, α::Vector{T})
function (::Type{DirichletMultinomial{T}}){T}(n::Integer, α::Vector{T})
α0 = sum(abs, α)
sum(α) == α0 || throw(ArgumentError("alpha must be a positive vector."))
n > 0 || throw(ArgumentError("n must be a positive integer."))
new(Int(n), α, α0)
new{T}(Int(n), α, α0)
end
end
DirichletMultinomial{T <: Real}(n::Integer, α::Vector{T}) = DirichletMultinomial{T}(n, α)
Expand Down
6 changes: 3 additions & 3 deletions src/multivariate/multinomial.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ immutable Multinomial{T<:Real} <: DiscreteMultivariateDistribution
n::Int
p::Vector{T}

function Multinomial(n::Integer, p::Vector{T})
function (::Type{Multinomial{T}}){T}(n::Integer, p::Vector{T})
if n < 0
throw(ArgumentError("n must be a nonnegative integer."))
end
if !isprobvec(p)
throw(ArgumentError("p = $p is not a probability vector."))
end
new(round(Int, n), p)
new{T}(round(Int, n), p)
end
Multinomial(n::Integer, p::Vector{T}, ::NoArgCheck) = new(round(Int, n), p)
(::Type{Multinomial{T}}){T}(n::Integer, p::Vector{T}, ::NoArgCheck) = new{T}(round(Int, n), p)
end
Multinomial{T<:Real}(n::Integer, p::Vector{T}) = Multinomial{T}(n, p)
Multinomial(n::Integer, k::Integer) = Multinomial{Float64}(round(Int, n), fill(1.0 / k, k))
Expand Down
12 changes: 6 additions & 6 deletions src/multivariate/mvnormal.jl
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,13 @@ end

const MultivariateNormal = MvNormal # for the purpose of backward compatibility

typealias IsoNormal MvNormal{Float64,ScalMat{Float64},Vector{Float64}}
typealias DiagNormal MvNormal{Float64,PDiagMat{Float64,Vector{Float64}},Vector{Float64}}
typealias FullNormal MvNormal{Float64,PDMat{Float64,Matrix{Float64}},Vector{Float64}}
const IsoNormal = MvNormal{Float64,ScalMat{Float64},Vector{Float64}}
const DiagNormal = MvNormal{Float64,PDiagMat{Float64,Vector{Float64}},Vector{Float64}}
const FullNormal = MvNormal{Float64,PDMat{Float64,Matrix{Float64}},Vector{Float64}}

typealias ZeroMeanIsoNormal MvNormal{Float64,ScalMat{Float64},ZeroVector{Float64}}
typealias ZeroMeanDiagNormal MvNormal{Float64,PDiagMat{Float64,Vector{Float64}},ZeroVector{Float64}}
typealias ZeroMeanFullNormal MvNormal{Float64,PDMat{Float64,Matrix{Float64}},ZeroVector{Float64}}
const ZeroMeanIsoNormal = MvNormal{Float64,ScalMat{Float64},ZeroVector{Float64}}
const ZeroMeanDiagNormal = MvNormal{Float64,PDiagMat{Float64,Vector{Float64}},ZeroVector{Float64}}
const ZeroMeanFullNormal = MvNormal{Float64,PDMat{Float64,Matrix{Float64}},ZeroVector{Float64}}

### Construction
function MvNormal{T<:Real}::Union{Vector{T}, ZeroVector{T}}, Σ::AbstractPDMat{T})
Expand Down
12 changes: 6 additions & 6 deletions src/multivariate/mvnormalcanon.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ immutable MvNormalCanon{T<:Real,P<:AbstractPDMat,V<:Union{Vector,ZeroVector}} <:
J::P # precision matrix, i.e. inv(Σ)
end

typealias FullNormalCanon MvNormalCanon{Float64, PDMat{Float64,Matrix{Float64}},Vector{Float64}}
typealias DiagNormalCanon MvNormalCanon{Float64,PDiagMat{Float64,Vector{Float64}},Vector{Float64}}
typealias IsoNormalCanon MvNormalCanon{Float64,ScalMat{Float64},Vector{Float64}}
const FullNormalCanon = MvNormalCanon{Float64, PDMat{Float64,Matrix{Float64}},Vector{Float64}}
const DiagNormalCanon = MvNormalCanon{Float64,PDiagMat{Float64,Vector{Float64}},Vector{Float64}}
const IsoNormalCanon = MvNormalCanon{Float64,ScalMat{Float64},Vector{Float64}}

typealias ZeroMeanFullNormalCanon MvNormalCanon{Float64,PDMat{Float64,Matrix{Float64}},ZeroVector{Float64}}
typealias ZeroMeanDiagNormalCanon MvNormalCanon{Float64,PDiagMat{Float64,Vector{Float64}},ZeroVector{Float64}}
typealias ZeroMeanIsoNormalCanon MvNormalCanon{Float64,ScalMat{Float64},ZeroVector{Float64}}
const ZeroMeanFullNormalCanon = MvNormalCanon{Float64,PDMat{Float64,Matrix{Float64}},ZeroVector{Float64}}
const ZeroMeanDiagNormalCanon = MvNormalCanon{Float64,PDiagMat{Float64,Vector{Float64}},ZeroVector{Float64}}
const ZeroMeanIsoNormalCanon = MvNormalCanon{Float64,ScalMat{Float64},ZeroVector{Float64}}


### Constructors
Expand Down
10 changes: 5 additions & 5 deletions src/multivariate/mvtdist.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ immutable GenericMvTDist{T<:Real, Cov<:AbstractPDMat} <: AbstractMvTDist
μ::Vector{T}
Σ::Cov

function GenericMvTDist(df::T, dim::Int, zmean::Bool, μ::Vector{T}, Σ::AbstractPDMat{T})
function (::Type{GenericMvTDist{T,Cov}}){T,Cov}(df::T, dim::Int, zmean::Bool, μ::Vector{T}, Σ::AbstractPDMat{T})
df > zero(df) || error("df must be positive")
new(df, dim, zmean, μ, Σ)
new{T,Cov}(df, dim, zmean, μ, Σ)
end
end

Expand Down Expand Up @@ -46,9 +46,9 @@ end

## Construction of multivariate normal with specific covariance type

typealias IsoTDist GenericMvTDist{Float64, ScalMat{Float64}}
typealias DiagTDist GenericMvTDist{Float64, PDiagMat{Float64,Vector{Float64}}}
typealias MvTDist GenericMvTDist{Float64, PDMat{Float64,Matrix{Float64}}}
const IsoTDist = GenericMvTDist{Float64, ScalMat{Float64}}
const DiagTDist = GenericMvTDist{Float64, PDiagMat{Float64,Vector{Float64}}}
const MvTDist = GenericMvTDist{Float64, PDMat{Float64,Matrix{Float64}}}

MvTDist(df::Real, μ::Vector{Float64}, C::PDMat) = GenericMvTDist(df, μ, C)
MvTDist(df::Real, C::PDMat) = GenericMvTDist(df, C)
Expand Down
4 changes: 2 additions & 2 deletions src/multivariate/vonmisesfisher.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ immutable VonMisesFisher{T<:Real} <: ContinuousMultivariateDistribution
κ::T
logCκ::T

function VonMisesFisher::Vector{T}, κ::T; checknorm::Bool=true)
function (::Type{VonMisesFisher{T}}){T}::Vector{T}, κ::T; checknorm::Bool=true)
if checknorm
isunitvec(μ) || error("μ must be a unit vector")
end
κ > 0 || error("κ must be positive.")
logCκ = vmflck(length(μ), κ)
S = promote_type(T, typeof(logCκ))
new(Vector{S}(μ), S(κ), S(logCκ))
new{T}(Vector{S}(μ), S(κ), S(logCκ))
end
end

Expand Down
2 changes: 1 addition & 1 deletion src/show.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function show(io::IO, d::Distribution, pnames)
uml ? show_multline(io, d, namevals) : show_oneline(io, d, namevals)
end

typealias _NameVal Tuple{Symbol,Any}
const _NameVal = Tuple{Symbol,Any}

function _use_multline_show(d::Distribution, pnames)
# decide whether to use one-line or multi-line format
Expand Down
2 changes: 1 addition & 1 deletion src/univariate/continuous/arcsine.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ immutable Arcsine{T<:Real} <: ContinuousUnivariateDistribution
a::T
b::T

Arcsine(a::T, b::T) = (@check_args(Arcsine, a < b); new(a, b))
(::Type{Arcsine{T}}){T}(a::T, b::T) = (@check_args(Arcsine, a < b); new{T}(a, b))
end

Arcsine{T<:Real}(a::T, b::T) = Arcsine{T}(a, b)
Expand Down
4 changes: 2 additions & 2 deletions src/univariate/continuous/beta.jl
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ immutable Beta{T<:Real} <: ContinuousUnivariateDistribution
α::T
β::T

function Beta::T, β::T)
function (::Type{Beta{T}}){T}::T, β::T)
@check_args(Beta, α > zero(α) && β > zero(β))
new(α, β)
new{T}(α, β)
end
end

Expand Down
Loading

0 comments on commit f4535a6

Please sign in to comment.