MixFit.jl
A package for fitting finite mixture models in Julia using random-swap expectation-maximization
Install / Use
/learn @euclaise/MixFit.jlREADME
MixFit.jl
MixFit.jl is a Julia package for fitting finite mixture models, and for nonparametric density estimation via finite mixture models (Wang & Chee, 2012). Models are fitted using random-swap expectation maximization (Zhao, Hautamäki, Kärkkäinen, & Fränti, 2012), which avoids the problem of local optimums by randomly replacing components and using the final maximum. By default, MixFit.jl supports normal, gamma, lognormal, and gumbel mixtures, but it is easy to use your own density function instead. If you use this, it would be nice if you cited me, but I'm putting it under public domain so you can do whatever you want with it.
Example
julia> using MixFit
julia> x = [randn(500); (randn(500).+3).*2]
1000-element Array{Float64,1}:
-0.3872542393168341
0.44218146773613404
-1.140006685489404
-0.11093365262262657
0.917287805330094
1.3997276699755827
⋮
3.860428712486353
4.924743765884938
4.767237225983121
3.6111782228201013
5.498455397469906
julia> densfit(x, criterion = AIC3)
----------------------------------
Log-likelihood: -2408.562390297034
AIC: 4827.124780594068
AIC3: 4832.124780594068
BIC: 4851.6635569889795
Component 1:
α: 0.5093992
μ: 0.07551261
σ: 1.0396444
Component 2:
α: 0.49060085
μ: 6.004384
σ: 2.0322912
----------------------------------
MixModel(Float32[0.5093992, 0.49060085], Float32[0.07551261, 6.004384], Float32[1.0396444, 2.0322912], MixFit.dnorm)
julia>
Related Skills
node-connect
345.4kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
104.6kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
345.4kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
345.4kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
