Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
davidavdav committed Mar 1, 2020
2 parents dd17737 + 604637c commit 77b72b5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/distributions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ end
## conversion to MixtureModel
function Distributions.MixtureModel(gmm::GMM{T}) where {T<:AbstractFloat}
if gmm.d == 1
mixtures = [Normal(gmm.μ[i,1], gmm.Σ[i,1]) for i=1:gmm.n]
mixtures = [Normal(gmm.μ[i,1], sqrt(gmm.Σ[i,1])) for i=1:gmm.n]
elseif kind(gmm) == :full
mixtures = [MvNormal(vec(gmm.μ[i,:]), covar(gmm.Σ[i])) for i=1:gmm.n]
else
mixtures = [MvNormal(vec(gmm.μ[i,:]), vec(gmm.Σ[i,:])) for i=1:gmm.n]
mixtures = [MvNormal(vec(gmm.μ[i,:]), sqrt(vec(gmm.Σ[i,:]))) for i=1:gmm.n]
end
MixtureModel(mixtures, gmm.w)
end

0 comments on commit 77b72b5

Please sign in to comment.