├── .gitignore
├── LICENSE
├── README.md
├── doc
└── source
│ ├── _jekyll
│ ├── _config.yml
│ ├── _includes
│ │ ├── after_footer.html
│ │ ├── breadcrumbs.html
│ │ ├── footer.html
│ │ └── head.html
│ ├── _layouts
│ │ ├── default.html
│ │ └── page.html
│ ├── css
│ │ ├── bootstrap.css
│ │ ├── bootstrap.min.css
│ │ ├── site.css
│ │ └── syntax.css
│ ├── font-awesome-4.1.0
│ │ ├── css
│ │ │ ├── font-awesome.css
│ │ │ └── font-awesome.min.css
│ │ ├── fonts
│ │ │ ├── FontAwesome.otf
│ │ │ ├── fontawesome-webfont.eot
│ │ │ ├── fontawesome-webfont.svg
│ │ │ ├── fontawesome-webfont.ttf
│ │ │ └── fontawesome-webfont.woff
│ │ ├── less
│ │ │ ├── bordered-pulled.less
│ │ │ ├── core.less
│ │ │ ├── fixed-width.less
│ │ │ ├── font-awesome.less
│ │ │ ├── icons.less
│ │ │ ├── larger.less
│ │ │ ├── list.less
│ │ │ ├── mixins.less
│ │ │ ├── path.less
│ │ │ ├── rotated-flipped.less
│ │ │ ├── spinning.less
│ │ │ ├── stacked.less
│ │ │ └── variables.less
│ │ └── scss
│ │ │ ├── _bordered-pulled.scss
│ │ │ ├── _core.scss
│ │ │ ├── _fixed-width.scss
│ │ │ ├── _icons.scss
│ │ │ ├── _larger.scss
│ │ │ ├── _list.scss
│ │ │ ├── _mixins.scss
│ │ │ ├── _path.scss
│ │ │ ├── _rotated-flipped.scss
│ │ │ ├── _spinning.scss
│ │ │ ├── _stacked.scss
│ │ │ ├── _variables.scss
│ │ │ └── font-awesome.scss
│ ├── fonts
│ │ ├── glyphicons-halflings-regular.eot
│ │ ├── glyphicons-halflings-regular.svg
│ │ ├── glyphicons-halflings-regular.ttf
│ │ └── glyphicons-halflings-regular.woff
│ └── js
│ │ ├── bootstrap.js
│ │ ├── bootstrap.min.js
│ │ ├── contact_me.js
│ │ ├── jqBootstrapValidation.js
│ │ ├── jquery.js
│ │ └── site.js
│ ├── _xsl
│ └── mxdom2jekyll.xsl
│ ├── api
│ └── img
│ │ ├── ecdfactory_01.png
│ │ ├── gammafactory_01.png
│ │ ├── mixturefactory_01.png
│ │ ├── mixturefactory_02.png
│ │ ├── mvn2factory_01.png
│ │ ├── mvnfactory_01.png
│ │ └── vmffactory_01.png
│ ├── caching.m
│ ├── data_input.m
│ ├── developer_guide.m
│ ├── distribution_parameters.m
│ ├── estimation_options.m
│ ├── estimation_statistics_structure.m
│ ├── helptoc.xml
│ ├── img
│ └── user_guide_01.png
│ ├── index.html
│ └── user_guide.m
├── examples
├── data2d.mat
├── data_iris.mat
├── data_sm.mat
├── example1.m
├── example2.m
├── example3.m
├── example4.m
└── mixspheregen.m
├── info.xml
├── install_mixest.m
├── mixest
├── auxiliary
│ ├── checking
│ │ ├── check_grad.m
│ │ ├── check_kl.m
│ │ ├── obj2vec.m
│ │ ├── objlen.m
│ │ └── vec2obj.m
│ ├── estimation
│ │ ├── mxe_adjustoptions.m
│ │ ├── mxe_costgrad.m
│ │ ├── mxe_crossvalidation.m
│ │ ├── mxe_ecostgrad.m
│ │ ├── mxe_egradbatch.m
│ │ ├── mxe_getplotdata.m
│ │ ├── mxe_getsolverhandle.m
│ │ ├── mxe_gradbatch.m
│ │ ├── mxe_inneroptions.m
│ │ ├── mxe_mergeinfo.m
│ │ ├── mxe_minibatch.m
│ │ ├── mxe_options.m
│ │ ├── mxe_plot.m
│ │ ├── mxe_plotavg.m
│ │ ├── mxe_stoppingcriterion.m
│ │ └── mxe_visualization.m
│ ├── manopt_manifolds
│ │ ├── euclidean
│ │ │ └── triufactory.m
│ │ ├── linesearch
│ │ │ ├── linesearch_wolfe.m
│ │ │ ├── linesearch_wolfe_euc.m
│ │ │ ├── linesearch_wolfe_old.m
│ │ │ └── polyinterp.m
│ │ ├── mxe_addsharedmanifold.m
│ │ ├── mxe_powermanifold.m
│ │ ├── mxe_product2manifold.m
│ │ ├── mxe_productmanifold.m
│ │ ├── positivedefinite
│ │ │ ├── hpdfactory.m
│ │ │ ├── positive2factory.m
│ │ │ ├── positivefactory.m
│ │ │ ├── spdfactory.m
│ │ │ ├── spdfactorytmp.m
│ │ │ ├── spdffactory.m
│ │ │ ├── sqrtm_fast.m
│ │ │ ├── sqrtm_triu_complex.c
│ │ │ ├── sqrtm_triu_negative.c
│ │ │ └── sqrtm_triu_real.c
│ │ ├── simplex
│ │ │ ├── productsimplexfactory.m
│ │ │ ├── simplexKfactory.m
│ │ │ └── simplexfactory.m
│ │ └── sphere
│ │ │ └── sphere2factory.m
│ ├── manopt_solvers
│ │ ├── getEuclideanCostGrad.m
│ │ ├── lbfgs
│ │ │ ├── desc_dir_cal.m
│ │ │ ├── lbfgs.m
│ │ │ └── lbfgs_update.m
│ │ └── sgd
│ │ │ ├── sgd.m
│ │ │ └── sgd_old.m
│ └── private_tools
│ │ ├── mxe_htmltable.m
│ │ ├── mxe_publishdocs.m
│ │ ├── mxe_readdata.m
│ │ ├── mxe_readweight.m
│ │ ├── mxe_scaleparam.m
│ │ ├── mxe_setfields.m
│ │ └── mxe_sumparam.m
├── distributions
│ ├── ag
│ │ ├── Integral_Method.m
│ │ ├── ag_estimatedefault.m
│ │ └── agfactory.m
│ ├── common
│ │ ├── doc_distribution_common.m
│ │ ├── mxe_AICc.m
│ │ ├── mxe_BIC.m
│ │ └── mxe_addsharedfields.m
│ ├── ecd
│ │ ├── ecd_eg_estimatedefault.m
│ │ ├── ecd_estimatedefault.m
│ │ └── ecdfactory.m
│ ├── factorial
│ │ ├── factorialfactory.m
│ │ └── factorialmogfactory.m
│ ├── gamma
│ │ ├── gamma_estimatedefault.m
│ │ └── gammafactory.m
│ ├── gaussianize
│ │ └── gaussianizationfactory.m
│ ├── mixture
│ │ ├── meg_estimatedefault.m
│ │ ├── mixture_estimatedefault.m
│ │ ├── mixture_mergecandidates.m
│ │ ├── mixture_mergeinit.m
│ │ ├── mixture_splitcandidates.m
│ │ ├── mixture_splitinit.m
│ │ ├── mixture_visualize.m
│ │ ├── mixturefactory.m
│ │ ├── mixturefactory_mashal.m
│ │ ├── mixturefactory_new.m
│ │ ├── moe_estimatedefault.m
│ │ └── moefactory.m
│ ├── mnl
│ │ └── mnlfactory.m
│ ├── mvn
│ │ ├── cmvn2factory.m
│ │ ├── cmvnfactory.m
│ │ ├── mvn2_estimatedefault.m
│ │ ├── mvn2cholfactory.m
│ │ ├── mvn2factory.m
│ │ ├── mvn2factorytmp.m
│ │ ├── mvn2factorytmp2.m
│ │ ├── mvn2icholfactory.m
│ │ ├── mvn_estimatedefault.m
│ │ ├── mvn_selfmerge.m
│ │ ├── mvn_selfsplit.m
│ │ ├── mvn_visualize.m
│ │ ├── mvnfactory.m
│ │ └── mvnicholfactory.m
│ └── vmf
│ │ ├── vmf_estimatedefault.m
│ │ ├── vmf_visualize.m
│ │ └── vmffactory.m
├── estimation
│ ├── mxe_estimate.m
│ └── split_and_merge
│ │ ├── cem.m
│ │ ├── smem.m
│ │ ├── smile.m
│ │ ├── totalmerge.m
│ │ ├── totalsplit.m
│ │ └── totalsplitopt.m
└── gates
│ ├── softmax_estimateMstep.m
│ └── softmaxfactory.m
├── paper
├── paper.bib
└── paper.md
├── tests
├── highlevel
│ ├── spiral.mat
│ ├── test_cem_spiral.m
│ ├── test_crossvalidation.m
│ ├── test_custom_splitinit.m
│ ├── test_ecd.m
│ ├── test_factorial.m
│ ├── test_functions.m
│ ├── test_minibatch.m
│ ├── test_mixture.m
│ ├── test_mnl.m
│ ├── test_mvn.m
│ ├── test_plotting.m
│ ├── test_previnfo.m
│ ├── test_simplex.m
│ ├── test_smem.m
│ ├── test_smile.m
│ └── test_totalsplit.m
├── test_gammafactory.m
├── test_mixturefactory.m
├── test_mvnfactory.m
├── test_mxe_crossvalidation.m
├── test_mxe_mergeinfo.m
├── test_mxe_minibatch.m
├── test_mxe_options.m
├── test_mxe_plot.m
├── test_mxe_plotavg.m
└── test_mxe_readdata.m
└── thirdparty
├── lightspeed
├── README.txt
├── license.txt
└── logsumexp.m
├── manopt
├── CLA.txt
├── COPYING.txt
├── CREDITS.txt
├── LICENSE.txt
├── README.txt
├── checkinstall
│ └── basicexample.m
├── examples
│ ├── dominant_invariant_subspace.m
│ ├── generalized_procrustes.m
│ ├── low_rank_matrix_completion.m
│ ├── maxcut.m
│ ├── maxcut_octave.m
│ ├── packing_on_the_sphere.m
│ ├── positive_definite_karcher_mean.m
│ ├── sparse_pca.m
│ └── truncated_svd.m
├── importmanopt.m
├── manopt
│ ├── manifolds
│ │ ├── complexcircle
│ │ │ └── complexcirclefactory.m
│ │ ├── euclidean
│ │ │ ├── euclideanfactory.m
│ │ │ └── symmetricfactory.m
│ │ ├── fixedrank
│ │ │ ├── fixedrankMNquotientfactory.m
│ │ │ ├── fixedrankembeddedfactory.m
│ │ │ ├── fixedrankfactory_2factors.m
│ │ │ ├── fixedrankfactory_2factors_preconditioned.m
│ │ │ ├── fixedrankfactory_2factors_subspace_projection.m
│ │ │ ├── fixedrankfactory_3factors.m
│ │ │ └── fixedrankfactory_3factors_preconditioned.m
│ │ ├── grassmann
│ │ │ └── grassmannfactory.m
│ │ ├── oblique
│ │ │ └── obliquefactory.m
│ │ ├── rotations
│ │ │ ├── randrot.m
│ │ │ ├── randskew.m
│ │ │ └── rotationsfactory.m
│ │ ├── sphere
│ │ │ ├── spherecomplexfactory.m
│ │ │ └── spherefactory.m
│ │ ├── stiefel
│ │ │ └── stiefelfactory.m
│ │ └── symfixedrank
│ │ │ ├── elliptopefactory.m
│ │ │ ├── spectrahedronfactory.m
│ │ │ ├── symfixedrankYYfactory.m
│ │ │ └── sympositivedefinitefactory.m
│ ├── privatetools
│ │ ├── applyStatsfun.m
│ │ ├── canGetCost.m
│ │ ├── canGetDirectionalDerivative.m
│ │ ├── canGetEuclideanGradient.m
│ │ ├── canGetGradient.m
│ │ ├── canGetHessian.m
│ │ ├── canGetLinesearch.m
│ │ ├── canGetPrecon.m
│ │ ├── getApproxHessian.m
│ │ ├── getCost.m
│ │ ├── getCostGrad.m
│ │ ├── getDirectionalDerivative.m
│ │ ├── getEuclideanGradient.m
│ │ ├── getGlobalDefaults.m
│ │ ├── getGradient.m
│ │ ├── getHessian.m
│ │ ├── getHessianFD.m
│ │ ├── getLinesearch.m
│ │ ├── getPrecon.m
│ │ ├── getStore.m
│ │ ├── hashmd5.m
│ │ ├── mergeOptions.m
│ │ ├── purgeStoredb.m
│ │ ├── setStore.m
│ │ └── stoppingcriterion.m
│ ├── solvers
│ │ ├── conjugategradient
│ │ │ └── conjugategradient.m
│ │ ├── linesearch
│ │ │ ├── linesearch.m
│ │ │ ├── linesearch_adaptive.m
│ │ │ └── linesearch_hint.m
│ │ ├── neldermead
│ │ │ ├── centroid.m
│ │ │ └── neldermead.m
│ │ ├── pso
│ │ │ └── pso.m
│ │ ├── steepestdescent
│ │ │ └── steepestdescent.m
│ │ └── trustregions
│ │ │ ├── license for original GenRTR code.txt
│ │ │ ├── tCG.m
│ │ │ └── trustregions.m
│ └── tools
│ │ ├── checkdiff.m
│ │ ├── checkgradient.m
│ │ ├── checkhessian.m
│ │ ├── diagsum.m
│ │ ├── hessianspectrum.m
│ │ ├── identify_linear_piece.m
│ │ ├── multiprod.m
│ │ ├── multiprodmultitransp_license.txt
│ │ ├── multiscale.m
│ │ ├── multiskew.m
│ │ ├── multisym.m
│ │ ├── multitrace.m
│ │ ├── multitransp.m
│ │ ├── plotprofile.m
│ │ ├── powermanifold.m
│ │ └── productmanifold.m
└── manopt_version.m
├── matlab-xunit-master
├── README.md
├── license.txt
└── src
│ ├── +xunit
│ └── +utils
│ │ ├── Contents.m
│ │ ├── arrayToString.m
│ │ ├── compareFloats.m
│ │ ├── comparisonMessage.m
│ │ ├── containsRegexp.m
│ │ ├── generateDoc.m
│ │ ├── isAlmostEqual.m
│ │ ├── isSetUpString.m
│ │ ├── isTearDownString.m
│ │ ├── isTestCaseSubclass.m
│ │ ├── isTestString.m
│ │ ├── parseFloatAssertInputs.m
│ │ └── stringToCellArray.m
│ ├── CommandWindowTestRunDisplay.m
│ ├── FunctionHandleTestCase.m
│ ├── TestCase.m
│ ├── TestCaseInDir.m
│ ├── TestCaseWithAddPath.m
│ ├── TestComponent.m
│ ├── TestComponentInDir.m
│ ├── TestRunDisplay.m
│ ├── TestRunLogger.m
│ ├── TestRunMonitor.m
│ ├── TestSuite.m
│ ├── TestSuiteInDir.m
│ ├── VerboseTestRunDisplay.m
│ ├── XMLTestRunLogger.m
│ ├── assertElementsAlmostEqual.m
│ ├── assertEqual.m
│ ├── assertExceptionThrown.m
│ ├── assertFalse.m
│ ├── assertFilesEqual.m
│ ├── assertTrue.m
│ ├── assertVectorsAlmostEqual.m
│ ├── initTestSuite.m
│ ├── runxunit.m
│ ├── xml_read.m
│ └── xml_write.m
├── randraw
├── license.txt
└── randraw.m
└── vmfmatlab
├── emsamp.m
├── house.m
├── logbesseli.m
├── mixinit.m
├── movmf.m
├── testmle.m
├── unitrand.m
└── vsamp.m
/.gitignore:
--------------------------------------------------------------------------------
1 | ##---------------------------------------------------
2 | ## Remove autosaves generated by the Matlab editor
3 | ## We have git for backups!
4 | ##---------------------------------------------------
5 |
6 | # Windows default autosave extension
7 | *.asv
8 |
9 | # OSX / *nix default autosave extension
10 | *.m~
11 | .DS_Store
12 |
13 | # Compiled MEX binaries (all platforms)
14 | *.mex*
15 |
16 | # Simulink Code Generation
17 | slprj/
18 |
19 | # Search databases (created by builddocsearchdb)
20 | helpsearch/
21 |
22 |
23 | # files only included in release versions
24 | doc/public/
25 | Contents.m
26 |
27 |
28 | # published html except for manually-created ones
29 | *.html
30 | !doc/source/*.html
31 | !doc/source/api/*.html
32 | !doc/source/examples/*.html
33 | !doc/source/_jekyll/_layouts/*.html
34 | !doc/source/_jekyll/_includes/*.html
35 |
36 | # published graphics except for manually-created ones
37 | *.png
38 | !doc/source/img/*.png
39 | !doc/source/api/img/*.png
40 | !doc/source/examples/img/*.png
41 |
42 | # other special files
43 | doc/source/_jekyll/helptoc.xml
--------------------------------------------------------------------------------
/doc/source/_jekyll/_config.yml:
--------------------------------------------------------------------------------
1 | # Site settings
2 | title: MixEst
3 | description: >
4 | MixEst - The Mixture-Model Estimation Toolbox
5 |
6 | # Build settings
7 | destination: ../../public
8 | markdown: kramdown
9 | highlighter: rouge #false # temporarily added because of pygments.rb issue on Windows
10 |
--------------------------------------------------------------------------------
/doc/source/_jekyll/_includes/after_footer.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/doc/source/_jekyll/_includes/breadcrumbs.html:
--------------------------------------------------------------------------------
1 |
2 | - Home
3 | {% assign crumbs = page.url | split: '/' %}
4 | {% assign crumbs_total = crumbs | size | minus: 1 %}
5 | {% for crumb in crumbs offset: 1 %}
6 | {% unless crumb == 'index.html' %}
7 | {% if forloop.index == crumbs_total %}
8 | - {{ crumb | remove: '.html' | replace:'_',' ' | replace:'-',' ' }}
9 | {% else %}
10 | - {{ crumb | remove: '.html' | replace:'_',' ' | replace:'-',' ' }}
11 | {% endif %}
12 | {% endunless %}
13 | {% endfor %}
14 |
--------------------------------------------------------------------------------
/doc/source/_jekyll/_includes/footer.html:
--------------------------------------------------------------------------------
1 |
2 |
9 |
--------------------------------------------------------------------------------
/doc/source/_jekyll/_includes/head.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | {% if page.title %}{{ page.title }} | {% endif %}{{ site.title }}
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
26 |
27 |
--------------------------------------------------------------------------------
/doc/source/_jekyll/_layouts/default.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | {% include head.html %}
5 |
6 |
7 |
8 |
9 |
10 | {{ content }}
11 |
12 | {% include footer.html %}
13 |
14 |
15 |
16 | {% include after_footer.html %}
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/doc/source/_jekyll/_layouts/page.html:
--------------------------------------------------------------------------------
1 | ---
2 | layout: default
3 | ---
4 |
5 |
6 |
7 |
9 |
10 | {% include breadcrumbs.html %}
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 | {{ content }}
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/doc/source/_jekyll/font-awesome-4.1.0/fonts/FontAwesome.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/utvisionlab/mixest/518bbe32366881223ae0adc25d1ad7ce5c18c563/doc/source/_jekyll/font-awesome-4.1.0/fonts/FontAwesome.otf
--------------------------------------------------------------------------------
/doc/source/_jekyll/font-awesome-4.1.0/fonts/fontawesome-webfont.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/utvisionlab/mixest/518bbe32366881223ae0adc25d1ad7ce5c18c563/doc/source/_jekyll/font-awesome-4.1.0/fonts/fontawesome-webfont.eot
--------------------------------------------------------------------------------
/doc/source/_jekyll/font-awesome-4.1.0/fonts/fontawesome-webfont.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/utvisionlab/mixest/518bbe32366881223ae0adc25d1ad7ce5c18c563/doc/source/_jekyll/font-awesome-4.1.0/fonts/fontawesome-webfont.ttf
--------------------------------------------------------------------------------
/doc/source/_jekyll/font-awesome-4.1.0/fonts/fontawesome-webfont.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/utvisionlab/mixest/518bbe32366881223ae0adc25d1ad7ce5c18c563/doc/source/_jekyll/font-awesome-4.1.0/fonts/fontawesome-webfont.woff
--------------------------------------------------------------------------------
/doc/source/_jekyll/font-awesome-4.1.0/less/bordered-pulled.less:
--------------------------------------------------------------------------------
1 | // Bordered & Pulled
2 | // -------------------------
3 |
4 | .@{fa-css-prefix}-border {
5 | padding: .2em .25em .15em;
6 | border: solid .08em @fa-border-color;
7 | border-radius: .1em;
8 | }
9 |
10 | .pull-right { float: right; }
11 | .pull-left { float: left; }
12 |
13 | .@{fa-css-prefix} {
14 | &.pull-left { margin-right: .3em; }
15 | &.pull-right { margin-left: .3em; }
16 | }
17 |
--------------------------------------------------------------------------------
/doc/source/_jekyll/font-awesome-4.1.0/less/core.less:
--------------------------------------------------------------------------------
1 | // Base Class Definition
2 | // -------------------------
3 |
4 | .@{fa-css-prefix} {
5 | display: inline-block;
6 | font-family: FontAwesome;
7 | font-style: normal;
8 | font-weight: normal;
9 | line-height: 1;
10 | -webkit-font-smoothing: antialiased;
11 | -moz-osx-font-smoothing: grayscale;
12 | }
13 |
--------------------------------------------------------------------------------
/doc/source/_jekyll/font-awesome-4.1.0/less/fixed-width.less:
--------------------------------------------------------------------------------
1 | // Fixed Width Icons
2 | // -------------------------
3 | .@{fa-css-prefix}-fw {
4 | width: (18em / 14);
5 | text-align: center;
6 | }
7 |
--------------------------------------------------------------------------------
/doc/source/_jekyll/font-awesome-4.1.0/less/font-awesome.less:
--------------------------------------------------------------------------------
1 | /*!
2 | * Font Awesome 4.1.0 by @davegandy - http://fontawesome.io - @fontawesome
3 | * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License)
4 | */
5 |
6 | @import "variables.less";
7 | @import "mixins.less";
8 | @import "path.less";
9 | @import "core.less";
10 | @import "larger.less";
11 | @import "fixed-width.less";
12 | @import "list.less";
13 | @import "bordered-pulled.less";
14 | @import "spinning.less";
15 | @import "rotated-flipped.less";
16 | @import "stacked.less";
17 | @import "icons.less";
18 |
--------------------------------------------------------------------------------
/doc/source/_jekyll/font-awesome-4.1.0/less/larger.less:
--------------------------------------------------------------------------------
1 | // Icon Sizes
2 | // -------------------------
3 |
4 | /* makes the font 33% larger relative to the icon container */
5 | .@{fa-css-prefix}-lg {
6 | font-size: (4em / 3);
7 | line-height: (3em / 4);
8 | vertical-align: -15%;
9 | }
10 | .@{fa-css-prefix}-2x { font-size: 2em; }
11 | .@{fa-css-prefix}-3x { font-size: 3em; }
12 | .@{fa-css-prefix}-4x { font-size: 4em; }
13 | .@{fa-css-prefix}-5x { font-size: 5em; }
14 |
--------------------------------------------------------------------------------
/doc/source/_jekyll/font-awesome-4.1.0/less/list.less:
--------------------------------------------------------------------------------
1 | // List Icons
2 | // -------------------------
3 |
4 | .@{fa-css-prefix}-ul {
5 | padding-left: 0;
6 | margin-left: @fa-li-width;
7 | list-style-type: none;
8 | > li { position: relative; }
9 | }
10 | .@{fa-css-prefix}-li {
11 | position: absolute;
12 | left: -@fa-li-width;
13 | width: @fa-li-width;
14 | top: (2em / 14);
15 | text-align: center;
16 | &.@{fa-css-prefix}-lg {
17 | left: -@fa-li-width + (4em / 14);
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/doc/source/_jekyll/font-awesome-4.1.0/less/mixins.less:
--------------------------------------------------------------------------------
1 | // Mixins
2 | // --------------------------
3 |
4 | .fa-icon-rotate(@degrees, @rotation) {
5 | filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=@rotation);
6 | -webkit-transform: rotate(@degrees);
7 | -moz-transform: rotate(@degrees);
8 | -ms-transform: rotate(@degrees);
9 | -o-transform: rotate(@degrees);
10 | transform: rotate(@degrees);
11 | }
12 |
13 | .fa-icon-flip(@horiz, @vert, @rotation) {
14 | filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=@rotation, mirror=1);
15 | -webkit-transform: scale(@horiz, @vert);
16 | -moz-transform: scale(@horiz, @vert);
17 | -ms-transform: scale(@horiz, @vert);
18 | -o-transform: scale(@horiz, @vert);
19 | transform: scale(@horiz, @vert);
20 | }
21 |
--------------------------------------------------------------------------------
/doc/source/_jekyll/font-awesome-4.1.0/less/path.less:
--------------------------------------------------------------------------------
1 | /* FONT PATH
2 | * -------------------------- */
3 |
4 | @font-face {
5 | font-family: 'FontAwesome';
6 | src: ~"url('@{fa-font-path}/fontawesome-webfont.eot?v=@{fa-version}')";
7 | src: ~"url('@{fa-font-path}/fontawesome-webfont.eot?#iefix&v=@{fa-version}') format('embedded-opentype')",
8 | ~"url('@{fa-font-path}/fontawesome-webfont.woff?v=@{fa-version}') format('woff')",
9 | ~"url('@{fa-font-path}/fontawesome-webfont.ttf?v=@{fa-version}') format('truetype')",
10 | ~"url('@{fa-font-path}/fontawesome-webfont.svg?v=@{fa-version}#fontawesomeregular') format('svg')";
11 | // src: url('@{fa-font-path}/FontAwesome.otf') format('opentype'); // used when developing fonts
12 | font-weight: normal;
13 | font-style: normal;
14 | }
15 |
--------------------------------------------------------------------------------
/doc/source/_jekyll/font-awesome-4.1.0/less/rotated-flipped.less:
--------------------------------------------------------------------------------
1 | // Rotated & Flipped Icons
2 | // -------------------------
3 |
4 | .@{fa-css-prefix}-rotate-90 { .fa-icon-rotate(90deg, 1); }
5 | .@{fa-css-prefix}-rotate-180 { .fa-icon-rotate(180deg, 2); }
6 | .@{fa-css-prefix}-rotate-270 { .fa-icon-rotate(270deg, 3); }
7 |
8 | .@{fa-css-prefix}-flip-horizontal { .fa-icon-flip(-1, 1, 0); }
9 | .@{fa-css-prefix}-flip-vertical { .fa-icon-flip(1, -1, 2); }
10 |
--------------------------------------------------------------------------------
/doc/source/_jekyll/font-awesome-4.1.0/less/spinning.less:
--------------------------------------------------------------------------------
1 | // Spinning Icons
2 | // --------------------------
3 |
4 | .@{fa-css-prefix}-spin {
5 | -webkit-animation: spin 2s infinite linear;
6 | -moz-animation: spin 2s infinite linear;
7 | -o-animation: spin 2s infinite linear;
8 | animation: spin 2s infinite linear;
9 | }
10 |
11 | @-moz-keyframes spin {
12 | 0% { -moz-transform: rotate(0deg); }
13 | 100% { -moz-transform: rotate(359deg); }
14 | }
15 | @-webkit-keyframes spin {
16 | 0% { -webkit-transform: rotate(0deg); }
17 | 100% { -webkit-transform: rotate(359deg); }
18 | }
19 | @-o-keyframes spin {
20 | 0% { -o-transform: rotate(0deg); }
21 | 100% { -o-transform: rotate(359deg); }
22 | }
23 | @keyframes spin {
24 | 0% {
25 | -webkit-transform: rotate(0deg);
26 | transform: rotate(0deg);
27 | }
28 | 100% {
29 | -webkit-transform: rotate(359deg);
30 | transform: rotate(359deg);
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/doc/source/_jekyll/font-awesome-4.1.0/less/stacked.less:
--------------------------------------------------------------------------------
1 | // Stacked Icons
2 | // -------------------------
3 |
4 | .@{fa-css-prefix}-stack {
5 | position: relative;
6 | display: inline-block;
7 | width: 2em;
8 | height: 2em;
9 | line-height: 2em;
10 | vertical-align: middle;
11 | }
12 | .@{fa-css-prefix}-stack-1x, .@{fa-css-prefix}-stack-2x {
13 | position: absolute;
14 | left: 0;
15 | width: 100%;
16 | text-align: center;
17 | }
18 | .@{fa-css-prefix}-stack-1x { line-height: inherit; }
19 | .@{fa-css-prefix}-stack-2x { font-size: 2em; }
20 | .@{fa-css-prefix}-inverse { color: @fa-inverse; }
21 |
--------------------------------------------------------------------------------
/doc/source/_jekyll/font-awesome-4.1.0/scss/_bordered-pulled.scss:
--------------------------------------------------------------------------------
1 | // Bordered & Pulled
2 | // -------------------------
3 |
4 | .#{$fa-css-prefix}-border {
5 | padding: .2em .25em .15em;
6 | border: solid .08em $fa-border-color;
7 | border-radius: .1em;
8 | }
9 |
10 | .pull-right { float: right; }
11 | .pull-left { float: left; }
12 |
13 | .#{$fa-css-prefix} {
14 | &.pull-left { margin-right: .3em; }
15 | &.pull-right { margin-left: .3em; }
16 | }
17 |
--------------------------------------------------------------------------------
/doc/source/_jekyll/font-awesome-4.1.0/scss/_core.scss:
--------------------------------------------------------------------------------
1 | // Base Class Definition
2 | // -------------------------
3 |
4 | .#{$fa-css-prefix} {
5 | display: inline-block;
6 | font-family: FontAwesome;
7 | font-style: normal;
8 | font-weight: normal;
9 | line-height: 1;
10 | -webkit-font-smoothing: antialiased;
11 | -moz-osx-font-smoothing: grayscale;
12 | }
13 |
--------------------------------------------------------------------------------
/doc/source/_jekyll/font-awesome-4.1.0/scss/_fixed-width.scss:
--------------------------------------------------------------------------------
1 | // Fixed Width Icons
2 | // -------------------------
3 | .#{$fa-css-prefix}-fw {
4 | width: (18em / 14);
5 | text-align: center;
6 | }
7 |
--------------------------------------------------------------------------------
/doc/source/_jekyll/font-awesome-4.1.0/scss/_larger.scss:
--------------------------------------------------------------------------------
1 | // Icon Sizes
2 | // -------------------------
3 |
4 | /* makes the font 33% larger relative to the icon container */
5 | .#{$fa-css-prefix}-lg {
6 | font-size: (4em / 3);
7 | line-height: (3em / 4);
8 | vertical-align: -15%;
9 | }
10 | .#{$fa-css-prefix}-2x { font-size: 2em; }
11 | .#{$fa-css-prefix}-3x { font-size: 3em; }
12 | .#{$fa-css-prefix}-4x { font-size: 4em; }
13 | .#{$fa-css-prefix}-5x { font-size: 5em; }
14 |
--------------------------------------------------------------------------------
/doc/source/_jekyll/font-awesome-4.1.0/scss/_list.scss:
--------------------------------------------------------------------------------
1 | // List Icons
2 | // -------------------------
3 |
4 | .#{$fa-css-prefix}-ul {
5 | padding-left: 0;
6 | margin-left: $fa-li-width;
7 | list-style-type: none;
8 | > li { position: relative; }
9 | }
10 | .#{$fa-css-prefix}-li {
11 | position: absolute;
12 | left: -$fa-li-width;
13 | width: $fa-li-width;
14 | top: (2em / 14);
15 | text-align: center;
16 | &.#{$fa-css-prefix}-lg {
17 | left: -$fa-li-width + (4em / 14);
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/doc/source/_jekyll/font-awesome-4.1.0/scss/_mixins.scss:
--------------------------------------------------------------------------------
1 | // Mixins
2 | // --------------------------
3 |
4 | @mixin fa-icon-rotate($degrees, $rotation) {
5 | filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=#{$rotation});
6 | -webkit-transform: rotate($degrees);
7 | -moz-transform: rotate($degrees);
8 | -ms-transform: rotate($degrees);
9 | -o-transform: rotate($degrees);
10 | transform: rotate($degrees);
11 | }
12 |
13 | @mixin fa-icon-flip($horiz, $vert, $rotation) {
14 | filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=#{$rotation});
15 | -webkit-transform: scale($horiz, $vert);
16 | -moz-transform: scale($horiz, $vert);
17 | -ms-transform: scale($horiz, $vert);
18 | -o-transform: scale($horiz, $vert);
19 | transform: scale($horiz, $vert);
20 | }
21 |
--------------------------------------------------------------------------------
/doc/source/_jekyll/font-awesome-4.1.0/scss/_path.scss:
--------------------------------------------------------------------------------
1 | /* FONT PATH
2 | * -------------------------- */
3 |
4 | @font-face {
5 | font-family: 'FontAwesome';
6 | src: url('#{$fa-font-path}/fontawesome-webfont.eot?v=#{$fa-version}');
7 | src: url('#{$fa-font-path}/fontawesome-webfont.eot?#iefix&v=#{$fa-version}') format('embedded-opentype'),
8 | url('#{$fa-font-path}/fontawesome-webfont.woff?v=#{$fa-version}') format('woff'),
9 | url('#{$fa-font-path}/fontawesome-webfont.ttf?v=#{$fa-version}') format('truetype'),
10 | url('#{$fa-font-path}/fontawesome-webfont.svg?v=#{$fa-version}#fontawesomeregular') format('svg');
11 | //src: url('#{$fa-font-path}/FontAwesome.otf') format('opentype'); // used when developing fonts
12 | font-weight: normal;
13 | font-style: normal;
14 | }
15 |
--------------------------------------------------------------------------------
/doc/source/_jekyll/font-awesome-4.1.0/scss/_rotated-flipped.scss:
--------------------------------------------------------------------------------
1 | // Rotated & Flipped Icons
2 | // -------------------------
3 |
4 | .#{$fa-css-prefix}-rotate-90 { @include fa-icon-rotate(90deg, 1); }
5 | .#{$fa-css-prefix}-rotate-180 { @include fa-icon-rotate(180deg, 2); }
6 | .#{$fa-css-prefix}-rotate-270 { @include fa-icon-rotate(270deg, 3); }
7 |
8 | .#{$fa-css-prefix}-flip-horizontal { @include fa-icon-flip(-1, 1, 0); }
9 | .#{$fa-css-prefix}-flip-vertical { @include fa-icon-flip(1, -1, 2); }
10 |
--------------------------------------------------------------------------------
/doc/source/_jekyll/font-awesome-4.1.0/scss/_spinning.scss:
--------------------------------------------------------------------------------
1 | // Spinning Icons
2 | // --------------------------
3 |
4 | .#{$fa-css-prefix}-spin {
5 | -webkit-animation: spin 2s infinite linear;
6 | -moz-animation: spin 2s infinite linear;
7 | -o-animation: spin 2s infinite linear;
8 | animation: spin 2s infinite linear;
9 | }
10 |
11 | @-moz-keyframes spin {
12 | 0% { -moz-transform: rotate(0deg); }
13 | 100% { -moz-transform: rotate(359deg); }
14 | }
15 | @-webkit-keyframes spin {
16 | 0% { -webkit-transform: rotate(0deg); }
17 | 100% { -webkit-transform: rotate(359deg); }
18 | }
19 | @-o-keyframes spin {
20 | 0% { -o-transform: rotate(0deg); }
21 | 100% { -o-transform: rotate(359deg); }
22 | }
23 | @keyframes spin {
24 | 0% {
25 | -webkit-transform: rotate(0deg);
26 | transform: rotate(0deg);
27 | }
28 | 100% {
29 | -webkit-transform: rotate(359deg);
30 | transform: rotate(359deg);
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/doc/source/_jekyll/font-awesome-4.1.0/scss/_stacked.scss:
--------------------------------------------------------------------------------
1 | // Stacked Icons
2 | // -------------------------
3 |
4 | .#{$fa-css-prefix}-stack {
5 | position: relative;
6 | display: inline-block;
7 | width: 2em;
8 | height: 2em;
9 | line-height: 2em;
10 | vertical-align: middle;
11 | }
12 | .#{$fa-css-prefix}-stack-1x, .#{$fa-css-prefix}-stack-2x {
13 | position: absolute;
14 | left: 0;
15 | width: 100%;
16 | text-align: center;
17 | }
18 | .#{$fa-css-prefix}-stack-1x { line-height: inherit; }
19 | .#{$fa-css-prefix}-stack-2x { font-size: 2em; }
20 | .#{$fa-css-prefix}-inverse { color: $fa-inverse; }
21 |
--------------------------------------------------------------------------------
/doc/source/_jekyll/font-awesome-4.1.0/scss/font-awesome.scss:
--------------------------------------------------------------------------------
1 | /*!
2 | * Font Awesome 4.1.0 by @davegandy - http://fontawesome.io - @fontawesome
3 | * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License)
4 | */
5 |
6 | @import "variables";
7 | @import "mixins";
8 | @import "path";
9 | @import "core";
10 | @import "larger";
11 | @import "fixed-width";
12 | @import "list";
13 | @import "bordered-pulled";
14 | @import "spinning";
15 | @import "rotated-flipped";
16 | @import "stacked";
17 | @import "icons";
18 |
--------------------------------------------------------------------------------
/doc/source/_jekyll/fonts/glyphicons-halflings-regular.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/utvisionlab/mixest/518bbe32366881223ae0adc25d1ad7ce5c18c563/doc/source/_jekyll/fonts/glyphicons-halflings-regular.eot
--------------------------------------------------------------------------------
/doc/source/_jekyll/fonts/glyphicons-halflings-regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/utvisionlab/mixest/518bbe32366881223ae0adc25d1ad7ce5c18c563/doc/source/_jekyll/fonts/glyphicons-halflings-regular.ttf
--------------------------------------------------------------------------------
/doc/source/_jekyll/fonts/glyphicons-halflings-regular.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/utvisionlab/mixest/518bbe32366881223ae0adc25d1ad7ce5c18c563/doc/source/_jekyll/fonts/glyphicons-halflings-regular.woff
--------------------------------------------------------------------------------
/doc/source/_jekyll/js/site.js:
--------------------------------------------------------------------------------
1 | // activate scrollspy and affix for sidenav
2 | $('body').scrollspy({ target: '#sidenav' });
3 | $('#sidenav').affix({
4 | offset: {
5 | top: 165
6 | }
7 | })
8 |
9 | // smooth scrolling
10 | $('a[href*=#]:not([href=#])').click(function() {
11 | if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
12 | var target = $(this.hash);
13 | target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
14 | if (target.length) {
15 | $('html,body').animate({
16 | scrollTop: target.offset().top
17 | }, 800);
18 | return false;
19 | }
20 | }
21 | });
22 |
23 | // Back to top
24 | $(document).ready(function(){
25 | $('body').append('
');
26 | $(window).scroll(function () {
27 | if ($(this).scrollTop() != 0) {
28 | $('#toTop').fadeIn();
29 | } else {
30 | $('#toTop').fadeOut();
31 | }
32 | });
33 | $('#toTop').click(function(){
34 | $("html, body").animate({ scrollTop: 0 }, 600);
35 | return false;
36 | });
37 | });
38 |
--------------------------------------------------------------------------------
/doc/source/api/img/ecdfactory_01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/utvisionlab/mixest/518bbe32366881223ae0adc25d1ad7ce5c18c563/doc/source/api/img/ecdfactory_01.png
--------------------------------------------------------------------------------
/doc/source/api/img/gammafactory_01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/utvisionlab/mixest/518bbe32366881223ae0adc25d1ad7ce5c18c563/doc/source/api/img/gammafactory_01.png
--------------------------------------------------------------------------------
/doc/source/api/img/mixturefactory_01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/utvisionlab/mixest/518bbe32366881223ae0adc25d1ad7ce5c18c563/doc/source/api/img/mixturefactory_01.png
--------------------------------------------------------------------------------
/doc/source/api/img/mixturefactory_02.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/utvisionlab/mixest/518bbe32366881223ae0adc25d1ad7ce5c18c563/doc/source/api/img/mixturefactory_02.png
--------------------------------------------------------------------------------
/doc/source/api/img/mvn2factory_01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/utvisionlab/mixest/518bbe32366881223ae0adc25d1ad7ce5c18c563/doc/source/api/img/mvn2factory_01.png
--------------------------------------------------------------------------------
/doc/source/api/img/mvnfactory_01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/utvisionlab/mixest/518bbe32366881223ae0adc25d1ad7ce5c18c563/doc/source/api/img/mvnfactory_01.png
--------------------------------------------------------------------------------
/doc/source/api/img/vmffactory_01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/utvisionlab/mixest/518bbe32366881223ae0adc25d1ad7ce5c18c563/doc/source/api/img/vmffactory_01.png
--------------------------------------------------------------------------------
/doc/source/caching.m:
--------------------------------------------------------------------------------
1 | %% Caching Intermediate Results
2 |
3 | %%
4 | % Some distribution functions allow for a special input and output named
5 | % |store|. This is a structure wherein the function can store the
6 | % intermediate calculation results that it has done for a set of inputs, as
7 | % its fields. These results might speed up things when calling another
8 | % function of the distribution with the same set of inputs. For instance,
9 | % the usual syntax for the |ll| function which calculates log-likelihoods
10 | % is:
11 | %
12 | % ll = D.ll(theta, data)
13 | %
14 | % But this function also admits the following syntax:
15 | %
16 | % [ll, store] = D.ll(theta, data, store)
17 | %
18 | % where, either |store| is optional. If we also need the gradient of the
19 | % log-likelihood (|llgrad|) for the same |theta| and |data|, we can use the
20 | % |store| output from the |ll| function as an input to the |llgrad|
21 | % function to prevent |llgrad| from re-calculating the intermediate values
22 | % which are shared in the two functions:
23 | %
24 | % [ll, store] = D.ll(theta, data);
25 | % dll = D.llgrad(theta, data, store);
26 | %
27 | % Please note that you should only share the |store| while working with the
28 | % same distribution and inputs (|theta| and |data|). When these are
29 | % changed, a new store structure should be used, or you will get wrong
30 | % results.
31 | %
32 |
--------------------------------------------------------------------------------
/doc/source/data_input.m:
--------------------------------------------------------------------------------
1 | %% Data Input Argument to Functions
2 | % In MixEst, all the functions taking a |data| input argument, can accept
3 | % the data in one of the following forms:
4 | %
5 |
6 | %% Data Matrix
7 | % In matrix form, the data is arranged in an n-by-N matrix where |n| is
8 | % the dimensions of the data space and |N| is the number of data points
9 | % (i.e. each column of the matrix represents a single observation).
10 | %
11 | % *Example*
12 | %
13 | % % create a distribution and random parameters
14 | % D = mvnfactory(2);
15 | % theta = D.randparam();
16 | % % generate 1000 random 2-dimensional data points
17 | % data = randn(2, 1000);
18 | % % pass the data to the ll function
19 | % ll = D.ll(theta, data)
20 | %
21 | % *Note:* In MATLAB versions R2011b and above, instead of the data matrix,
22 | % you can give a |matlab.io.MatFile| object referring to a MAT-file
23 | % containing a variable named |data| with specifications as pointed out
24 | % above.
25 | %
26 |
27 | %% Data Structure
28 | % Using the structure form, you can pass along with the data matrix, the
29 | % indices of a subset of data points and/or a weighting vector on the data
30 | % points whenever applicable. In this form, |data| is a structure with the
31 | % following fields (All fields except |data| are optional):
32 | %
33 | % * *|data|* (|n-by-N|) The data matrix as described in the previous
34 | % section.
35 | % * *|index|* (|1-by-L|) Data indexing vector for selecting a subset of
36 | % data (Only numeric indexing is supported. Logical indexing is not
37 | % supported).
38 | % * *|weight|* (|1-by-N|, or |1-by-L| if indexing is used) Data weighting
39 | % vector containing values between zero and one to be multiplied by each
40 | % data point.
41 | %
42 | % where |n| is the dimensions of the data space, |N| is the total number of
43 | % data points, and |L| is the number of points in the indexed subset of
44 | % data.
45 | %
46 | % *Example 1*
47 | %
48 | % % create a distribution and random parameters
49 | % D = mvnfactory(2);
50 | % theta = D.randparam();
51 | % % generate 1000 random 2-dimensional data points
52 | % data = randn(2, 1000);
53 | % % use only the 100th up to 200th points from the data
54 | % index = 100:200;
55 | % % generate random weights for the selected data
56 | % weight = rand(1, 101); % 101 is the number of elements in index
57 | % % build the data structure
58 | % data = struct('data', data, 'index', index, 'weight', weight);
59 | % % pass the data to the ll function
60 | % ll = D.ll(theta, data)
61 | %
62 | % *Example 2*
63 | %
64 | % D = mvnfactory(2);
65 | % theta = D.randparam();
66 | % ll = D.ll(theta, struct('data', randn(2,1000), 'weight', rand(1,1000)))
67 | %
--------------------------------------------------------------------------------
/doc/source/distribution_parameters.m:
--------------------------------------------------------------------------------
1 | %% Distribution Parameters Structure
2 | % Since by design, we keep the distribution parameters apart from the
3 | % distribution structure, many functions of the distributions require a
4 | % parameter structure |theta| to be passed in, or output this parameter
5 | % structure. In what follows we describe this structure in detail (well,
6 | % there is not that much detail, actually).
7 | %
8 |
9 | %% Structure Description
10 | % |theta| is a structure with field names corresponding to parameter names
11 | % defined in the respective distribution, and values equal to the desired
12 | % parameter values.
13 | %
14 | % *Example*
15 | %
16 | % The parameters for a multi-variate normal distribution are |mu| for the
17 | % mean, and |sigma| for the covariance matrix. So we can construct a
18 | % parameter structure for this distribution like this:
19 | %
20 | % theta = struct('mu', [1; 2], 'sigma', [2 1; 3 4]);
21 | %
22 | % or equivalently like this:
23 | %
24 | % theta.mu = [1; 2];
25 | % theta.sigma = [2 1; 3 4];
26 | %
27 | % Then we can pass |theta| to the distribution functions. For example:
28 | %
29 | % D = mvnfactory(2);
30 | % h = D.entropy(theta)
31 | %
32 | % h =
33 | % 3.8108
34 | %
35 |
36 | %% Relation with Manopt Manifolds
37 | % MixEst distribution parameter structures (|theta|) are actually points on
38 | % some specific manifold representing the compound geometry of valid values
39 | % for all of the parameters of the distribution. The manifold is created
40 | % using the |productmanifold| function from the to build a product of the manifolds corresponding to each
42 | % parameter, and therefore you can work with the value of each parameter
43 | % using a field in |theta|.
44 | %
45 | % The Manopt manifold of parameters for a distribution structure |D| can be
46 | % accessed using |D.M|.
47 | %
48 |
--------------------------------------------------------------------------------
/doc/source/estimation_statistics_structure.m:
--------------------------------------------------------------------------------
1 | %% Estimation Statistics Structure
2 |
3 | %%
4 | % Every iterative estimation function in MixEst, returns some information
5 | % about its progress at each iteration. This information is output as the
6 | % structure array |info| from the estimation function:
7 | %
8 | % [theta, D, info, options] = estimation_function(...)
9 | %
10 | % Each element in |info| is a structure with fields corresponding to each
11 | % logged info. For instance |info(1).iter| contains zero (since the
12 | % iterations are numbered starting at zero) and |info(end).iter| contains
13 | % the last iteration number. You may also use the |[info.cost]| syntax to
14 | % get all the logged costs for all iterations as a vector. The following
15 | % example plots the cost by iterations:
16 | %
17 | % plot([info.iter], [info.cost])
18 | %
19 | % You can find information about the fields present in |info| output for
20 | % each estimation function in its documentation. When a Manopt solver is
21 | % used in the estimation, the |info| returned by the Manopt solver is
22 | % returned directly.
23 | %
--------------------------------------------------------------------------------
/doc/source/helptoc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | MixEst Toolbox
5 | User Guide
6 |
7 | API Reference
8 |
9 | Examples
10 |
11 | Developer Guide
12 |
13 | Online Web Site
14 |
15 |
16 |
--------------------------------------------------------------------------------
/doc/source/img/user_guide_01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/utvisionlab/mixest/518bbe32366881223ae0adc25d1ad7ce5c18c563/doc/source/img/user_guide_01.png
--------------------------------------------------------------------------------
/doc/source/user_guide.m:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/utvisionlab/mixest/518bbe32366881223ae0adc25d1ad7ce5c18c563/doc/source/user_guide.m
--------------------------------------------------------------------------------
/examples/data2d.mat:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/utvisionlab/mixest/518bbe32366881223ae0adc25d1ad7ce5c18c563/examples/data2d.mat
--------------------------------------------------------------------------------
/examples/data_iris.mat:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/utvisionlab/mixest/518bbe32366881223ae0adc25d1ad7ce5c18c563/examples/data_iris.mat
--------------------------------------------------------------------------------
/examples/data_sm.mat:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/utvisionlab/mixest/518bbe32366881223ae0adc25d1ad7ce5c18c563/examples/data_sm.mat
--------------------------------------------------------------------------------
/examples/example1.m:
--------------------------------------------------------------------------------
1 | %% Example 1
2 |
3 | %%
4 | % This example visualizes the estimation process of a mixture of three
5 | % Gaussians on sample 2-D data.
6 | %
7 |
8 | function example1
9 |
10 | clc
11 | clear
12 | close all
13 |
14 | load data2d
15 |
16 | num = 3;
17 | D = mixturefactory(mvn2factory(2), num);
18 |
19 |
20 | % graphical visualization
21 | figure('Units', 'normalized', 'OuterPosition', [0 0 1 1])
22 | options.visualization.axes = subplot(2,2,[1 3]);
23 | options.visualization.mixture.colorize = true;
24 | % options.visualization.dataPlotType = 'scatter';
25 | options.visualization.stopOnClose = true;
26 |
27 | % plotting
28 | options.plotCost.axes = subplot(2,2,2);
29 | options.plotGradNorm.axes = subplot(2,2,4);
30 |
31 | % main options
32 | options.verbosity = 2;
33 | options.solver = 'sgd';
34 | options.sgd.stepsize = 1;
35 | batchnum = size(data,2)/(2*5);
36 | it = 20;
37 | options.sgd.batchnum = batchnum;
38 | options.sgd.base = 10^(-3/batchnum/it);
39 | % options.crossVal = true;
40 | % options.crossVal.tolIter = 100;
41 | % options.tolCostDiff = -Inf;
42 | options.penalize = true;
43 | % options.minibatch.iter = 5;
44 | % options.minibatch.discardHistory = false;
45 | % options.minibatch.size = 300;
46 | % options.regularize = true;
47 |
48 | % perform estimation
49 | D.estimate(data, options)
50 |
--------------------------------------------------------------------------------
/examples/example2.m:
--------------------------------------------------------------------------------
1 | %% Example 2
2 |
3 | %%
4 | % This example uses a mixture of multinomial logistic experts to classify
5 | % Fisher's iris data.
6 | %
7 |
8 | function example2
9 |
10 | clc
11 | clear
12 | %close all
13 |
14 | load data_iris
15 |
16 | % random permute the iris data
17 | index = randperm(150);
18 | % load rndprm150
19 | data = data(:, index);
20 |
21 | % Use 120 data for training
22 | data_train = data(:, 1:120);
23 | data_test = data(:, 121:150);
24 | datadim = size(data_train,1) - 1;
25 | num = max(data(end,:),[], 2);
26 |
27 | % create a mixture of multivariate logit
28 | nummix = 3; % number of components in gate
29 | E = mnlfactory(datadim, num); % expert
30 | G = softmaxfactory(nummix, datadim); % gate
31 | D = moefactory(G, E);
32 | %D = E;
33 | % figure('units', 'normalized', 'outerposition', [0 0 1 1])
34 |
35 | % plotting options
36 | options.plotcost = true;
37 |
38 |
39 | % main options
40 | options.verbosity = 2;
41 | options.solver = 'lbfgs';
42 | options.tolcostdiff = 1e-6;
43 | %options.crossval = true;
44 | options.minibatch.size = 10;
45 | options.maxiter = 200;
46 | options.minibatch.discardhistory = false;
47 | options.crossval.toliter = 100;
48 |
49 | % perform estimation
50 | theta = D.estimate(data_train, options);
51 |
52 | % perform prediction
53 | data_pred = D.predict(theta, data_test);
54 | label = data_test(end,:)
55 | data_pred
56 | disp(['percentage of correct classification : ' ...
57 | num2str(sum((label-data_pred)==0) * 100 /30)]);
--------------------------------------------------------------------------------
/examples/example3.m:
--------------------------------------------------------------------------------
1 | %% Example 3
2 |
3 | %%
4 | % This example visualizes the estimation process of a mixture of von
5 | % Mises-Fisher distributions on sample data.
6 | %
7 |
8 | function example3
9 |
10 | clc
11 | clear
12 | close all
13 |
14 | num = 5;
15 | D = mixturefactory(vmffactory(3), num);
16 |
17 | theta = D.randparam();
18 | for k = 1 : num
19 | theta.D{k}.kappa = theta.D{k}.kappa*10 +10;
20 | end
21 |
22 | data = D.sample(theta, 5000);
23 |
24 | figure('units', 'normalized', 'outerposition', [0 0 1 1])
25 |
26 | % graphical visualization
27 | options.visualization.axes = subplot(2,2,[1 3]);
28 | options.visualization.mixture.colorize = true;
29 | % options.visualization.dataplottype = 'scatter';
30 |
31 |
32 | % % graphical visualization init
33 | % viz = subplot(2,2,[1 3]);
34 | % plot3(viz, data(1, :), data(2, :), data(3, :), '.', ...
35 | % 'MarkerSize', 4, 'Marker', '.');
36 | % options.stopfun = @(D, theta, info, last) stopfun(D, theta, data, viz);
37 |
38 |
39 | % plotting options
40 | options.plotcost.axes = subplot(2,2,2);
41 | options.plotgradnorm.axes = subplot(2,2,4);
42 |
43 | % main options
44 | options.verbosity = 2;
45 | options.solver = 'default';
46 | % options.crossval = true;
47 | % options.cvtoliter = 100;
48 | options.tolcostdiff = 1e-5;
49 | %options.penalize = true;
50 | %options.minibatchiter = 5;
51 | %options.minibatchdiscardhistory = false;
52 | %options.minibatchsize = 300;
53 | options.regularize = true;
54 | % perform estimation
55 | D.estimate(data, options);
56 |
57 |
58 | function stopnow = stopfun(D, theta, data, viz)
59 | % update the graphical visualization
60 | colors = hsv(D.num()); % {[ 0 0 1], [0 1 0], [1 0 0]};
61 | weights = D.weighting(theta, data);
62 | [notused, ind] = max(weights,[],1);
63 | hold(viz, 'off');
64 | for k = 1 : D.num()
65 | mu = theta.D{k}.mu;
66 | plot3(viz, data(1,ind==k), data(2,ind==k), data(3,ind==k), '.', ...
67 | 'MarkerSize', 4, 'Color', colors(k,:), 'Marker', '.');
68 | %set(h, 'MarkerSize', 4, 'Color', colors{k}, 'Marker', '.');
69 | h = line([0 mu(1)], [0 mu(2)], [0 mu(3)], 'Parent', viz, ...
70 | 'LineWidth', 2, 'Color', colors(k,:));
71 | %set(h, 'LineWidth', 2, 'Color', colors{k}, 'Parent', viz);
72 | if k == 1
73 | hold(viz, 'on');
74 | end
75 | end
76 | drawnow
77 | pause(0.3)
78 | stopnow = false;
--------------------------------------------------------------------------------
/examples/example4.m:
--------------------------------------------------------------------------------
1 | %% Example 4
2 |
3 | %%
4 | % This example visualizes the estimation process of a modified version of
5 | % the Competitive EM (CEM) algorithm (Zhang et al., 2004) on sample 2-D
6 | % data.
7 | %
8 |
9 | function example4
10 |
11 | clc
12 | clear
13 | close all
14 |
15 | f = load('data_sm');
16 | data = f.data;
17 |
18 | % visualization and plotting options
19 | figure('Units', 'normalized', 'OuterPosition', [0 0 1 1])
20 | options.visualization.axes = subplot(2,2,[1 3]);
21 | options.plotCost.axes = subplot(2,2,2);
22 | options.plotGradNorm.axes = subplot(2,2,4);
23 | options.visualization.mixture.colorize = true;
24 | options.visualization.stopOnClose = true;
25 |
26 | % common estimation options
27 | options.verbosity = 1;
28 | options.solver = 'lbfgs';
29 | options.tolCostDiff = 1e-3;
30 |
31 | % % split-and-merge options
32 | % options.sm.splitCriterion = 'kl';
33 | % options.sm.mergeCriterion = 'kl';
34 | % options.sm.splitInit = 'default';
35 | % options.sm.mergeInit = 'default';
36 | % options.sm.numInit = 1;
37 | % options.sm.numMin = 1;
38 | % options.sm.numMax = 15;
39 | % options.sm.mergeMaxCands = 5;
40 | % options.sm.splitMaxCands = 5;
41 | % options.sm.maxFail = 2;
42 | % options.sm.ComponentD = mvnfactory2(2);
43 |
44 |
45 | % run
46 | splitTmerge(data, 7, options)
47 |
--------------------------------------------------------------------------------
/info.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 | -
6 | MixEst
7 | toolbox
8 |
9 | doc/public/
10 | $toolbox/matlab/icons/bookicon.gif
11 |
12 |
--------------------------------------------------------------------------------
/install_mixest.m:
--------------------------------------------------------------------------------
1 | function install_mixest
2 |
3 | fprintf('Installing the MixEst toolbox...\n');
4 |
5 | % Find required paths
6 | this_file = mfilename('fullpath'); % get this file's path and name (without .m)
7 | toolbox_root_path = fileparts(this_file);
8 |
9 | % Add MixEst folders to search path
10 | fprintf('Adding MixEst folders to search path...\n');
11 | addpath(toolbox_root_path)
12 | addpath(genpath(fullfile(toolbox_root_path, 'mixest')))
13 | addpath(genpath(fullfile(toolbox_root_path, 'thirdparty')))
14 | fprintf('[Done]\n')
15 |
16 | % Compile mex files
17 | fprintf('Compiling mex files...\n');
18 | mex_dir = fullfile(toolbox_root_path, 'mixest', 'auxiliary', 'manopt_manifolds', 'positivedefinite');
19 | mex('-outdir', mex_dir, fullfile(mex_dir, 'sqrtm_triu_real.c'));
20 | mex('-outdir', mex_dir, fullfile(mex_dir, 'sqrtm_triu_complex.c'));
21 | fprintf('[Done]\n')
22 |
23 | fprintf('\nMixEst has been successfully installed.\n');
24 | fprintf('You can use "Set Path" -> "Save" from MATLAB menus to save the added paths permanently.\n\n');
25 |
26 | % build search database for the documentation
27 | fprintf('Building search database for the documentation (Optional Step)...\n')
28 | builddocsearchdb(fullfile(toolbox_root_path, 'doc', 'public'))
29 | fprintf('[Done]\n')
30 |
31 | fprintf('\nAll Done!\n\n')
32 |
--------------------------------------------------------------------------------
/mixest/auxiliary/checking/check_grad.m:
--------------------------------------------------------------------------------
1 | %% |check_grad|
2 | % *Note:* This is a private function.
3 | %
4 | % Checking gradient derivation of log-likelihood
5 | %
6 | % *Syntax*
7 | %
8 | % check_grad(D, theta, data)
9 | %
10 |
11 | % Copyright 2015 Reshad Hosseini and Mohamadreza Mash'al
12 | % This file is part of MixEst: visionlab.ut.ac.ir/mixest
13 | %
14 | % Contributors:
15 | % Reshad Hosseini
16 | % Mohamadreza Mash'al
17 | %
18 | % Change log:
19 | %
20 |
21 | function check_grad(D, theta, data)
22 |
23 | if nargin < 3
24 | nrd = 10000;
25 | data = D.sample(theta, nrd);
26 | else
27 | data = mxe_readdata(data);
28 | nrd = data.size;
29 | data = data.data;
30 | end
31 |
32 | disp(['Numerical Checking using ' num2str(nrd) ' datapoints']);
33 |
34 | % First checking the entropy derivation
35 | disp(' ');
36 | disp('+++ Checking Gradient -> grad(theta) +++');
37 | x0 = obj2vec(theta);
38 | gnum = finidiff(x0, @(x)fun(D, theta, x, data));
39 | [f, gth] = fun(D, theta, x0, data);
40 |
41 | disp([' Numerical Gradient: ' num2str(gnum)]);
42 | disp([' Theoretical Gradient: ' num2str(gth')]);
43 | disp([' Maximum Difference: ',num2str(max(abs(gnum-gth')))]);
44 |
45 |
46 | function g = finidiff(x, fun)
47 |
48 | f = fun(x);
49 | len = length(x);
50 | delf = zeros(1,len);
51 | mu = 1e-6*(1+norm(x))/len;
52 | for k = 1:len
53 | e_k = zeros(len,1);
54 | e_k(k) = 1;
55 | delf(k) = fun(x + mu*e_k);
56 | end
57 | g = (delf-f)/mu;
58 |
59 |
60 | function [y, dy] = fun(D, theta, x, data)
61 |
62 | px = vec2obj(theta, x);
63 | if nargout>1
64 | [y, store] = D.ll(px, data);
65 | dd = D.llgrad(px, data, store);
66 | dy = obj2vec(dd);
67 | else
68 | y = D.ll(px, data);
69 | end
--------------------------------------------------------------------------------
/mixest/auxiliary/checking/check_kl.m:
--------------------------------------------------------------------------------
1 | %% |check_kl|
2 | % *Note:* This is a private function.
3 | %
4 | % Checking kl-divergence derivation
5 | %
6 | % *Syntax*
7 | %
8 | % check_kl(D, p1, p2)
9 | %
10 |
11 | % Copyright 2015 Reshad Hosseini and Mohamadreza Mash'al
12 | % This file is part of MixEst: visionlab.ut.ac.ir/mixest
13 | %
14 | % Contributors:
15 | % Reshad Hosseini
16 | % Mohamadreza Mash'al
17 | %
18 | % Change log:
19 | %
20 |
21 | function check_kl(D, p1, p2)
22 |
23 | if nargin < 3
24 | p2 = D.randparam();
25 | end
26 | if nargin < 2
27 | p1 = D.randparam();
28 | end
29 | nrd = 200000;
30 | disp(['Numerical Checking using ' num2str(nrd) ' datapoints']);
31 | data = D.sample(p1, nrd);
32 |
33 | % First checking the entropy derivation
34 | disp(' ');
35 | disp('+++ Checking Entropy -> entropy(theta1) +++');
36 | disp([' Numerical Entropy:' num2str(-D.ll(p1,data)/nrd)]);
37 | disp([' Theoretical Entropy:' num2str(D.entropy(p1))]);
38 |
39 | % Now checking kl-divergence derivation
40 | disp(' ');
41 | disp('+++ Checking KL-divergence -> kl(theta1||theta2) +++');
42 | disp([' Numerical KL:' num2str((D.ll(p1,data)-D.ll(p2,data))/nrd)]);
43 | disp([' Theoretical KL:' num2str(D.kl(p1,p2))]);
--------------------------------------------------------------------------------
/mixest/auxiliary/checking/obj2vec.m:
--------------------------------------------------------------------------------
1 | %% |obj2vec|
2 | % *Note:* This is a private function.
3 | %
4 | % Convert the object into a vector
5 | %
6 | % *Syntax*
7 | %
8 | % vecOut = obj2vec(obj)
9 | %
10 |
11 | % Copyright 2015 Reshad Hosseini and Mohamadreza Mash'al
12 | % This file is part of MixEst: visionlab.ut.ac.ir/mixest
13 | %
14 | % Contributors:
15 | % Reshad Hosseini
16 | % Mohamadreza Mash'al
17 | %
18 | % Change log:
19 | %
20 |
21 | function vecOut = obj2vec(obj)
22 |
23 | if isobject(obj)
24 | vecOut = obj.obj2vec();
25 | elseif iscell(obj)
26 | L=objlen(obj);
27 | vecOut=zeros(L,1);
28 | beginIt=0;
29 | for k=1:length(obj)
30 | l=objlen(obj{k});
31 | if l>0
32 | vecOut( beginIt+1:beginIt+l)=obj2vec(obj{k});
33 | end
34 | beginIt=beginIt+l;
35 | end
36 | elseif isstruct(obj)
37 | st=fieldnames(obj);
38 | L=objlen(obj);
39 | vecOut=zeros(L,1);
40 | beginIt=0;
41 | for k=1:length(st)
42 | l=objlen(obj.(st{k}));
43 | if l>0
44 | vecOut(beginIt+1:beginIt+l)=obj2vec( obj.(st{k}) );
45 | end
46 | beginIt=beginIt+l;
47 | end
48 | elseif isnumeric(obj)
49 | vecOut=obj(:);
50 | else ischar(obj)
51 | vecOut=[];
52 | end
--------------------------------------------------------------------------------
/mixest/auxiliary/checking/objlen.m:
--------------------------------------------------------------------------------
1 | %% |objlen|
2 | % *Note:* This is a private function.
3 | %
4 | % Calculate the number of numerical elements in obj
5 | %
6 | % *Syntax*
7 | %
8 | % l = objlen(obj)
9 | %
10 |
11 | % Copyright 2015 Reshad Hosseini and Mohamadreza Mash'al
12 | % This file is part of MixEst: visionlab.ut.ac.ir/mixest
13 | %
14 | % Contributors:
15 | % Reshad Hosseini
16 | % Mohamadreza Mash'al
17 | %
18 | % Change log:
19 | %
20 |
21 | function l = objlen(obj)
22 |
23 | if isobject(obj)
24 | l = obj.objlen();
25 | elseif iscell(obj)
26 | l=0;
27 | for k=1:length(obj)
28 | l=l+objlen(obj{k});
29 | end
30 | elseif isstruct(obj)
31 | st=fieldnames(obj);
32 | l=0;
33 | for k=1:length(st)
34 | l=l+objlen(obj.(st{k}));
35 | end
36 | elseif isnumeric(obj)
37 | l=numel(obj);
38 | elseif ischar(obj)
39 | l=0;
40 | end
--------------------------------------------------------------------------------
/mixest/auxiliary/checking/vec2obj.m:
--------------------------------------------------------------------------------
1 | %% |vec2obj|
2 | % *Note:* This is a private function.
3 | %
4 | % Convert the vector |vec| into an object like the sample object |obj|
5 | %
6 | % *Syntax*
7 | %
8 | % obj = vec2obj(obj, vec)
9 | %
10 |
11 | % Copyright 2015 Reshad Hosseini and Mohamadreza Mash'al
12 | % This file is part of MixEst: visionlab.ut.ac.ir/mixest
13 | %
14 | % Contributors:
15 | % Reshad Hosseini
16 | % Mohamadreza Mash'al
17 | %
18 | % Change log:
19 | %
20 |
21 | function obj = vec2obj(obj, vec)
22 |
23 | if isobject(obj)
24 | obj = obj.vec2obj(vec);
25 | elseif iscell(obj)
26 | beginIt = 0;
27 | for k = 1:length(obj)
28 | l = objlen(obj{k});
29 | if l > 0
30 | obj{k} = vec2obj( obj{k}, vec(beginIt+1:beginIt+l) );
31 | end
32 | beginIt = beginIt + l;
33 | end
34 | elseif isstruct(obj)
35 | st = fieldnames(obj);
36 | beginIt = 0;
37 | for k = 1:length(st)
38 | l = objlen(obj.(st{k}));
39 | if l > 0
40 | obj.(st{k}) = vec2obj( obj.(st{k}), vec(beginIt+1:beginIt+l) );
41 | end
42 | beginIt = beginIt + l;
43 | end
44 | elseif isnumeric(obj)
45 | obj = reshape(vec, size(obj));
46 | end
--------------------------------------------------------------------------------
/mixest/auxiliary/estimation/mxe_adjustoptions.m:
--------------------------------------------------------------------------------
1 | %% |mxe_adjustoptions|
2 | % *Note:* This is a private function.
3 | %
4 | % Makes the required adjustments to |options| fields like |maxiter| when
5 | % using |options.previnfo| to continue from a previous estimation.
6 | %
7 | % *Syntax*
8 | %
9 | % options = mxe_adjustoptions(options, stats)
10 | %
11 |
12 | % Copyright 2015 Reshad Hosseini and Mohamadreza Mash'al
13 | % This file is part of MixEst: visionlab.ut.ac.ir/mixest
14 | %
15 | % Contributors:
16 | % Reshad Hosseini
17 | % Mohamadreza Mash'al
18 | %
19 | % Change log:
20 | %
21 |
22 | function options = mxe_adjustoptions(options, stats)
23 | % stats is normally options.previnfo(end)
24 |
25 | options.miniter = options.miniter + stats.iter;
26 | options.maxiter = options.maxiter + stats.iter;
27 | if isfield(stats, 'time')
28 | options.maxtime = options.maxtime + stats.time;
29 | end
30 | if isfield(stats, 'costevals')
31 | options.maxcostevals = options.maxcostevals + stats.costevals;
32 | end
33 |
34 | end
--------------------------------------------------------------------------------
/mixest/auxiliary/estimation/mxe_egradbatch.m:
--------------------------------------------------------------------------------
1 | %% |mxe_costgrad|
2 | % *Note:* This is a private function.
3 | %
4 | % Returns the Riemannian gradient of cost (negative log-likelihood)
5 | % with respect to distribution parameters calculated on data, considering
6 | % penalization, etc. Used in gradient-based estimation functions.
7 | %
8 | % Since it is for SGD no databatchsize is necessary
9 | %
10 | %
11 | % *Syntax*
12 | %
13 | % grad = mxe_gradbatch(D, theta, data, options)
14 | %
15 |
16 | % Copyright 2015 Reshad Hosseini and Mohamadreza Mash'al
17 | % This file is part of MixEst: visionlab.ut.ac.ir/mixest
18 | %
19 | % Contributors:
20 | % Reshad Hosseini
21 | % Mohamadreza Mash'al
22 | %
23 | % Change log:
24 | %
25 |
26 | function egrad = mxe_egradbatch(D, theta, data, batch_index, options)
27 | % Note: options are NOT optional here. Following fields are required:
28 | %
29 | % * penalize
30 | % * penalizerTheta (must contain valid penalizer parameters if penalize is true)
31 | % * dataPatchSize
32 | %
33 |
34 | if nargin < 5
35 | options.sgd.batchnum = 1;
36 | batch_index = 1;
37 | end
38 | % We don't use Manopt stores because it reduces performance due to
39 | % calculating the gradient in line-search.
40 | data = mxe_readdata(data, false);
41 | idx = data.index;
42 | datamat = data.data;
43 | data_size = length(idx);
44 |
45 | if options.penalize
46 | % Calculating the penalizer gradient
47 | egradPen = D.penalizergrad(theta, options.penalizertheta);
48 | end
49 |
50 | egrad = D.llgrad(theta, datamat(:, idx(batch_index)));
51 | egrad = D.scaleparam(-1/length(batch_index), egrad);
52 | if options.penalize
53 | egradPen = D.scaleparam(-1/data_size, egradPen);
54 | egrad = D.sumparam(egrad, egradPen);
55 | end
56 |
57 | end
58 |
--------------------------------------------------------------------------------
/mixest/auxiliary/estimation/mxe_getplotdata.m:
--------------------------------------------------------------------------------
1 | %% |mxe_getplotdata|
2 | % *Note:* This is a private function.
3 | %
4 | % Extract plot data from info
5 | %
6 | % *Syntax*
7 | %
8 | % [ploty, plotx] = mxe_getplotdata(fieldname, plot_options, info, last)
9 | % [ploty, plotx] = mxe_getplotdata(fieldname, plot_options, info, last, previter, allinfo, allinfolast)
10 | %
11 |
12 | % Copyright 2015 Reshad Hosseini and Mohamadreza Mash'al
13 | % This file is part of MixEst: visionlab.ut.ac.ir/mixest
14 | %
15 | % Contributors:
16 | % Reshad Hosseini
17 | % Mohamadreza Mash'al
18 | %
19 | % Change log:
20 | %
21 |
22 | function [ploty, plotx] = mxe_getplotdata(fieldname, plot_options, info, last, previter, allinfo, allinfolast)
23 |
24 | if nargin < 5
25 |
26 |
27 | if plot_options.itercount <= last
28 | % available info is enough
29 | plotx = [info(last-plot_options.itercount+1 : last).iter];
30 | ploty = [info(last-plot_options.itercount+1 : last).(fieldname)];
31 | else
32 | % available info is less than iterCount
33 | plotx = [info(1:last).iter];
34 | ploty = [info(1:last).(fieldname)];
35 | end
36 |
37 |
38 | else
39 |
40 |
41 | iterCount = plot_options.itercount;
42 | if iterCount == Inf
43 | % iterCount==Inf => plot all info
44 | if previter > 0
45 | plotx = [allinfo.iter, info(2:last).iter];
46 | ploty = [allinfo.(fieldname), info(2:last).(fieldname)];
47 | else
48 | plotx = [info(1:last).iter];
49 | ploty = [info(1:last).(fieldname)];
50 | end
51 | elseif iterCount 0
57 | % we need info from previous runs
58 | startidx = max(allinfolast - (iterCount - last), 1);
59 | plotx = [allinfo(startidx:allinfolast).iter, info(2:last).iter];
60 | ploty = [allinfo(startidx:allinfolast).(fieldname), info(2:last).(fieldname)];
61 | else
62 | % available info is less than iterCount
63 | plotx = [info(1:last).iter];
64 | ploty = [info(1:last).(fieldname)];
65 | end
66 |
67 |
68 | end
69 |
70 |
71 | % averaged plotting
72 | if plot_options.avgiter > 1
73 | [plotx, ploty] = mxe_plotavg(plotx, ploty, plot_options.avgiter);
74 | end
75 | end
76 |
--------------------------------------------------------------------------------
/mixest/auxiliary/estimation/mxe_getsolverhandle.m:
--------------------------------------------------------------------------------
1 | %% |mxe_getsolverhandle|
2 | % *Note:* This is a private function.
3 | %
4 | % Returns function handle to a manopt solver given its name
5 | %
6 | % *Syntax*
7 | %
8 | % h = mxe_getsolverhandle(solverName)
9 | %
10 |
11 | % Copyright 2015 Reshad Hosseini and Mohamadreza Mash'al
12 | % This file is part of MixEst: visionlab.ut.ac.ir/mixest
13 | %
14 | % Contributors:
15 | % Reshad Hosseini
16 | % Mohamadreza Mash'al
17 | %
18 | % Change log:
19 | %
20 |
21 | function h = mxe_getsolverhandle(solverName)
22 |
23 | switch lower(solverName)
24 | case {'cg', 'conjugategradient'}
25 | h = @conjugategradient;
26 | case 'lbfgs'
27 | h = @lbfgs;
28 | case {'tr', 'trustregions'}
29 | h = @trustregions;
30 | case {'sd', 'gd', 'steepestdescent', 'gradientdescent'}
31 | h = @steepestdescent;
32 | case {'sgd', 'stochasticgradientdescent'}
33 | h = @sgd;
34 | %TODO
35 | otherwise
36 | error('Solver "%s" not defined in mxe_getsolverhandle.', solverName)
37 | end
38 | end
39 |
40 |
--------------------------------------------------------------------------------
/mixest/auxiliary/estimation/mxe_gradbatch.m:
--------------------------------------------------------------------------------
1 | %% |mxe_costgrad|
2 | % *Note:* This is a private function.
3 | %
4 | % Returns the Riemannian gradient of cost (negative log-likelihood)
5 | % with respect to distribution parameters calculated on data, considering
6 | % penalization, etc. Used in gradient-based estimation functions.
7 | %
8 | % Since it is for SGD no databatchsize is necessary
9 | %
10 | %
11 | % *Syntax*
12 | %
13 | % grad = mxe_gradbatch(D, theta, data, options)
14 | %
15 |
16 | % Copyright 2015 Reshad Hosseini and Mohamadreza Mash'al
17 | % This file is part of MixEst: visionlab.ut.ac.ir/mixest
18 | %
19 | % Contributors:
20 | % Reshad Hosseini
21 | % Mohamadreza Mash'al
22 | %
23 | % Change log:
24 | %
25 |
26 | function grad = mxe_gradbatch(D, theta, data, batch_index, options)
27 | % Note: options are NOT optional here. Following fields are required:
28 | %
29 | % * penalize
30 | % * penalizerTheta (must contain valid penalizer parameters if penalize is true)
31 | % * dataPatchSize
32 | %
33 |
34 | if nargin < 5
35 | options.sgd.batchnum = 1;
36 | batch_index = 1;
37 | end
38 | % We don't use Manopt stores because it reduces performance due to
39 | % calculating the gradient in line-search.
40 | data = mxe_readdata(data, false);
41 | idx = data.index;
42 | datamat = data.data;
43 | data_size = length(idx);
44 |
45 | if options.penalize
46 | % Calculating the penalizer gradient
47 | egradPen = D.penalizergrad(theta, options.penalizertheta);
48 | end
49 |
50 | egrad = D.llgrad(theta, datamat(:, idx(batch_index)));
51 | egrad = D.scaleparam(-1/length(batch_index), egrad);
52 | if options.penalize
53 | egradPen = D.scaleparam(-1/data_size, egradPen);
54 | egrad = D.sumparam(egrad, egradPen);
55 | end
56 |
57 | grad = D.M.egrad2rgrad(theta, egrad);
58 |
59 | end
60 |
--------------------------------------------------------------------------------
/mixest/auxiliary/estimation/mxe_inneroptions.m:
--------------------------------------------------------------------------------
1 | %% |mxe_inneroptions|
2 | % *Note:* This is a private function.
3 | %
4 | % Read options for inner estimations
5 | %
6 | % *Syntax*
7 | %
8 | % inner_options = mxe_inneroptions(options, inner_defaults, subfield)
9 | %
10 |
11 | % Copyright 2015 Reshad Hosseini and Mohamadreza Mash'al
12 | % This file is part of MixEst: visionlab.ut.ac.ir/mixest
13 | %
14 | % Contributors:
15 | % Reshad Hosseini
16 | % Mohamadreza Mash'al
17 | %
18 | % Change log:
19 | %
20 |
21 | function inner_options = mxe_inneroptions(options, inner_defaults, subfield)
22 | % |options|: full options, possibly containing options.inner fields given by the user
23 | % |inner_defaults| (optional): specific defaults for the inner options
24 | % |subfield| (optional): specific sub-field of options.inner, used to address specific inner estimation functions between various functions
25 | %
26 | % The estimation functions that call other estimation functions inside,
27 | % should use this function to get the options for the inner estimation
28 | % functions. They can give specific defaults using the |inner_defaults|
29 | % argument and also they may give |subfield|, defining a specific name
30 | % distinguishing the inner estimation from any other inner estimations, in
31 | % order to enable the user to change the options for that specific inner
32 | % estimation by |options.inner.(subfield).(option)|.
33 | %
34 | % The priorities for setting the output options are as follows:
35 | % 1. |options.inner| (if set by the user)
36 | % 2. |inner_defaults|
37 | % 3. |options| (outer options)
38 |
39 |
40 | if isfield(options, 'inner')
41 | user_options = options.inner;
42 | options = rmfield(options, 'inner');
43 |
44 | if nargin>2 && isfield(user_options, subfield)
45 | user_options = user_options.(subfield);
46 | end
47 | else
48 | user_options = [];
49 | end
50 |
51 | if nargin > 1
52 | options = mxe_setfields(options, inner_defaults);
53 | end
54 |
55 | inner_options = mxe_setfields(options, user_options);
56 |
57 | end
--------------------------------------------------------------------------------
/mixest/auxiliary/estimation/mxe_mergeinfo.m:
--------------------------------------------------------------------------------
1 | %% |mxe_mergeinfo|
2 | % *Note:* This is a private function.
3 | %
4 | % Merge info structure arrays, considering memory pre-allocation
5 | %
6 | % *Syntax*
7 | %
8 | % [info, last] = mxe_mergeinfo(info, last, newinfo)
9 | % [info, last] = mxe_mergeinfo(info, last, newinfo, maxiter)
10 | % [info, last] = mxe_mergeinfo(info, last, newinfo, maxiter, field_names_differ)
11 | %
12 |
13 | % Copyright 2015 Reshad Hosseini and Mohamadreza Mash'al
14 | % This file is part of MixEst: visionlab.ut.ac.ir/mixest
15 | %
16 | % Contributors:
17 | % Reshad Hosseini
18 | % Mohamadreza Mash'al
19 | %
20 | % Change log:
21 | %
22 |
23 | function [info, last] = mxe_mergeinfo(info, last, newinfo, maxiter, field_names_differ)
24 | % maxiter: max size for info
25 | % field_names_differ: flag to use the hard way
26 |
27 | % if info is empty, return the newinfo
28 | if isempty(info)
29 | info = newinfo;
30 | last = numel(newinfo);
31 | return
32 | end
33 |
34 | % if newinfo is empty, return the info untouched
35 | if isempty(newinfo)
36 | return
37 | end
38 |
39 | if nargin < 5
40 | field_names_differ = false;
41 | end
42 | if nargin < 4
43 | maxiter = Inf;
44 | end
45 |
46 | % update allinfo and pre-allocate if necessary
47 | allinfosize = numel(info);
48 | infosize = numel(newinfo)-1;
49 | tobelast = last + infosize;
50 | if tobelast > allinfosize
51 | allinfosize = min(tobelast+10000, maxiter+1);
52 | info(allinfosize).iter = [];
53 | end
54 |
55 | if ~field_names_differ
56 | % perform the merge
57 | info(last+1 : tobelast) = newinfo(2:end);
58 | last = tobelast;
59 | return
60 | end
61 |
62 | % manage different field names
63 | fn_info = fieldnames(info);
64 | fn_newinfo = fieldnames(newinfo);
65 |
66 | % find field names in newinfo that are not in info
67 | idx_newinfo = find(~ismember(fn_newinfo, fn_info));
68 | % add them to info
69 | for m = idx_newinfo
70 | info(1).(fn_newinfo{m}) = [];
71 | end
72 |
73 | % find field names in info that are not in newinfo
74 | idx_info = find(~ismember(fn_info, fn_newinfo));
75 | % add them to newinfo
76 | for m = idx_info
77 | newinfo(1).(fn_info{m}) = [];
78 | end
79 |
80 | % we need to make the struct fields in the same order
81 | info = orderfields(info);
82 | newinfo = orderfields(newinfo);
83 |
84 | % perform the merge
85 | info(last+1 : tobelast) = newinfo(2:end);
86 | last = tobelast;
87 | end
88 |
--------------------------------------------------------------------------------
/mixest/auxiliary/estimation/mxe_minibatch.m:
--------------------------------------------------------------------------------
1 | %% |mxe_minibatch|
2 | % *Note:* This is a private function.
3 | %
4 | % Returns a structure used for mini batch optimization
5 | %
6 | % *Syntax*
7 | %
8 | % [mb, idxMBTrain] = mxe_minibatch(idxAllTrain, options)
9 | %
10 |
11 | % Copyright 2015 Reshad Hosseini and Mohamadreza Mash'al
12 | % This file is part of MixEst: visionlab.ut.ac.ir/mixest
13 | %
14 | % Contributors:
15 | % Reshad Hosseini
16 | % Mohamadreza Mash'al
17 | %
18 | % Change log:
19 | %
20 |
21 | function [mb, idxMBTrain] = mxe_minibatch(idxAllTrain, options)
22 |
23 | minibatchsize = options.minibatch.size;
24 | minibatchoverlap = options.minibatch.overlap;
25 |
26 | nAllTrain = numel(idxAllTrain);
27 | idxMiniBatch = 1:min(minibatchsize, nAllTrain);
28 | idxMBTrain = idxAllTrain(idxMiniBatch);
29 |
30 | mb.next = @next;
31 | function idxMBTrain = next()
32 |
33 | if nAllTrain <= minibatchsize
34 | idxMiniBatch = 1:nAllTrain;
35 | else
36 |
37 | idxMiniBatchEnd = mod(idxMiniBatch(end) - minibatchoverlap - 1, nAllTrain) + 1;
38 | if idxMiniBatchEnd >= nAllTrain
39 | idxMiniBatch = 1:minibatchsize;
40 | else
41 | nAvailable = nAllTrain - idxMiniBatchEnd;
42 | if nAvailable >= minibatchsize
43 | idxMiniBatch = idxMiniBatchEnd + 1 : idxMiniBatchEnd + minibatchsize;
44 | else
45 | idxMiniBatch = [idxMiniBatchEnd + 1 : idxMiniBatchEnd + nAvailable, ...
46 | 1 : minibatchsize - nAvailable];
47 | end
48 | end
49 |
50 | end
51 | idxMBTrain = idxAllTrain(idxMiniBatch);
52 | end
53 | end
--------------------------------------------------------------------------------
/mixest/auxiliary/estimation/mxe_plotavg.m:
--------------------------------------------------------------------------------
1 | %% |mxe_plotavg|
2 | % *Note:* This is a private function.
3 | %
4 | % Function used in averaged plotting
5 | %
6 | % *Syntax*
7 | %
8 | % [plotx, ploty] = mxe_plotavg(plotx, ploty, avgiter)
9 | %
10 |
11 | % Copyright 2015 Reshad Hosseini and Mohamadreza Mash'al
12 | % This file is part of MixEst: visionlab.ut.ac.ir/mixest
13 | %
14 | % Contributors:
15 | % Reshad Hosseini
16 | % Mohamadreza Mash'al
17 | %
18 | % Change log:
19 | %
20 |
21 | function [plotx, ploty] = mxe_plotavg(plotx, ploty, avgiter)
22 |
23 | % make the number of elements of plot data a multiple of
24 | % plotavg, by removing extra elements from its start.
25 | n = numel(plotx);
26 | m = mod(n, avgiter);
27 | if m > 0
28 | n = n - m;
29 | plotx = plotx(:, end-n+1:end);
30 | ploty = ploty(:, end-n+1:end);
31 | end
32 |
33 | % average every avgiter iterations
34 | temp = reshape(ploty, avgiter, []);
35 | ploty = mean(temp, 1);
36 |
37 | % update plotx also
38 | idx = avgiter : avgiter : n;
39 | plotx = plotx(:, idx);
40 | end
--------------------------------------------------------------------------------
/mixest/auxiliary/manopt_manifolds/euclidean/triufactory.m:
--------------------------------------------------------------------------------
1 | function M = triufactory(m, n)
2 | % Returns a manifold struct over m-by-n lower-triangular matrices.
3 | %
4 | % function M = triufactory(m, n)
5 | %
6 | % Returns M, a structure describing the Euclidean space of lower-triangular
7 | % m-by-n matrices equipped with the standard Frobenius distance and
8 | % associated trace inner product as a manifold for Manopt.
9 |
10 | % Copyright 2015 Reshad Hosseini and Mohamadreza Mash'al
11 | % This file is part of MixEst: visionlab.ut.ac.ir/mixest
12 | %
13 | % Original author: Reshad Hosseini, Aug, 08, 2015
14 |
15 |
16 | if ~exist('n', 'var') || isempty(n)
17 | n = 1;
18 | end
19 |
20 | M.name = @() sprintf('Euclidean space R^(%dx%d)', m, n);
21 |
22 | M.dim = @() m*n;
23 |
24 | M.inner = @(x, d1, d2) d1(:).'*d2(:);
25 |
26 | M.norm = @(x, d) norm(d, 'fro');
27 |
28 | M.dist = @(x, y) norm(x-y, 'fro');
29 |
30 | M.typicaldist = @() sqrt(m*n);
31 |
32 | M.proj = @(x, d) triu(d);
33 |
34 | M.egrad2rgrad = @(x, g) triu(g);
35 |
36 | M.ehess2rhess = @(x, eg, eh, d) eh;
37 |
38 | M.tangent = M.proj;
39 |
40 | M.exp = @exp;
41 | function y = exp(x, d, t)
42 | if nargin == 3
43 | y = x + t*d;
44 | else
45 | y = x + d;
46 | end
47 | y = triu(y);
48 | end
49 |
50 | M.retr = M.exp;
51 |
52 | M.log = @(x, y) triu(y-x);
53 |
54 | M.hash = @(x) ['z' hashmd5(x(:))];
55 |
56 | M.rand = @() triu(randn(m, n));
57 |
58 | M.randvec = @randvec;
59 | function u = randvec(x) %#ok
60 | u = triu(randn(m, n));
61 | u = u / norm(u, 'fro');
62 | end
63 |
64 | M.lincomb = @lincomb;
65 | function v = lincomb(x, a1, d1, a2, d2) %#ok
66 | if nargin == 3
67 | v = a1*d1;
68 | elseif nargin == 5
69 | v = a1*d1 + a2*d2;
70 | else
71 | error('Bad usage of euclidean.lincomb');
72 | end
73 | end
74 |
75 | M.zerovec = @(x) zeros(m, n);
76 |
77 | M.transp = @(x1, x2, d) d;
78 |
79 | M.pairmean = @(x1, x2) triu(.5*(x1+x2));
80 |
81 | M.vec = @(x, u_mat) u_mat(:);
82 | M.mat = @(x, u_vec) reshape(u_vec, [m, n]);
83 | M.vecmatareisometries = @() true;
84 |
85 | end
86 |
--------------------------------------------------------------------------------
/mixest/auxiliary/manopt_manifolds/positivedefinite/sqrtm_fast.m:
--------------------------------------------------------------------------------
1 | %% |sqrtm_fast|
2 | % Calculate matrix square root using Schur decomposition
3 | %
4 | % *Syntax*
5 | %
6 | % As = sqrtm_fast(A)
7 | %
8 |
9 | % Copyright 2015 Reshad Hosseini and Mohamadreza Mash'al
10 | % This file is part of MixEst: visionlab.ut.ac.ir/mixest
11 | %
12 | % Original author: Reshad Hosseini
13 | %
14 | % Change log:
15 | %
16 |
17 | function As=sqrtm_fast(A)
18 |
19 | % ToDO:For Hermitian positive definite there is a faster version based on
20 | % Chapter 6 of "Functions of Matrices" by N. J. Higham
21 | %
22 | if any(isinf(A(:))) || any(isnan(A(:)))
23 | As = eye(size(A));
24 | return
25 | end
26 |
27 | [U,T]=schur(A,'complex');
28 | if isequal(T,diag(diag(T)))
29 | % case of symmetric or hermitian input
30 | Ts = diag(sqrt(diag(T)));
31 | elseif isreal(T) && all(diag(T)>0)
32 | % case of non-symmetric or non-hermitial positive definite input
33 | Ts = sqrtm_triu_real(T);
34 | elseif isreal(T)
35 | % case of real input
36 | Ts = sqrtm_triu_negative(T);
37 | else
38 | Ts = sqrtm_triu_complex(T);
39 | end
40 | As = U * Ts * U';
41 | if isreal(A)
42 | if all(imag(As) == 0)
43 | As = real(As);
44 | end
45 | end
--------------------------------------------------------------------------------
/mixest/auxiliary/manopt_manifolds/positivedefinite/sqrtm_triu_real.c:
--------------------------------------------------------------------------------
1 | /* Function for calculating the square root of upper triangular matrix
2 | * when matrix is real with positive diagonals
3 | * Written by Reshad Hosseini*/
4 | #include "mex.h"
5 | #include //needed for sqrt
6 | //#include //needed for memcpy
7 |
8 | void mexFunction(int nlhs, mxArray *plhs[],
9 | int nrhs, const mxArray *prhs[]) {
10 | int m, n, i, j, k;
11 | double *Tr, *Sr;
12 | double num, denum, s;
13 |
14 | if(nrhs != 1 || nlhs > 1)
15 | mexErrMsgTxt("Usage: Ts = sqrtm_triu(T)");
16 |
17 | /* prhs[0] is first argument.
18 | * mxGetPr returns double* (data, col-major)
19 | * mxGetM returns int (rows)
20 | * mxGetN returns int (cols)
21 | */
22 | /* m = rows(T) */
23 | m = mxGetM(prhs[0]);
24 | n = mxGetN(prhs[0]);
25 | if(m != n) mexErrMsgTxt("matrix must be square");
26 |
27 | //if(mxIsSparse(prhs[1])) {
28 | // mexErrMsgTxt("Can not handle sparse matrices yet.");
29 | //}
30 |
31 | if(mxGetNumberOfDimensions(prhs[0]) != 2) {
32 | mexErrMsgTxt("Arguments must be matrices.");
33 | }
34 |
35 | Tr = mxGetPr(prhs[0]);
36 |
37 | /* Set the output pointer to the output matrix. */
38 | plhs[0] = mxCreateDoubleMatrix(m, n, mxREAL);
39 |
40 | /* Create a C pointer to a copy of the output matrix. */
41 | Sr = mxGetPr(plhs[0]);
42 |
43 | /* copy T into Ts to speed up memory access */
44 | //memcpy(Ts, T, m*n*sizeof(double));
45 | for(j=0;j=0;i--) {
47 | *(Sr + i + m*j) = *(Tr + i + m*j);
48 | }
49 | }
50 |
51 | /* Upper triangular */
52 | for(j=0;j=0;i--) {
58 | s = 0;
59 | for(k=i+1;k' ...
26 | '' ...
27 | '
' ...
28 | '' ...
29 | '' ...
30 | ];
31 |
32 | % table header
33 | names = fieldnames(S);
34 | for i = 1 : numel(names)
35 | html = [html sprintf('%s | ', strrep(names{i},'_',' ') )]; %#ok
36 | end
37 |
38 | html = [html ...
39 | '
' ...
40 | '' ...
41 | '' ...
42 | ];
43 |
44 | % table rows
45 | for n = 1 : numel(S)
46 | html = [html '']; %#ok
47 | for i = 1 : numel(names)
48 | html = [html sprintf('%s | ', value2str( S(n).(names{i}) ) )]; %#ok
49 | end
50 | html = [html '
']; %#ok
51 | end
52 |
53 | html = [html ...
54 | '' ...
55 | '
' ...
56 | '
' ...
57 | '