Hidden Markov Model (HMM)

  • Fit with Baum-Welch EM algorithm
  • demo

					var nbstates = 2;
					var obsdim = 3;
					var hmm1 = new HiddenMarkovModel(nbstates, obsdim);
					// simulation
					var pathLength = 200;
					var points = hmm1.simulateStates(pathLength, true).observations;
					// estimation
					var hmm2 = new HiddenMarkovModel(nbstates, obsdim);
					var maxIters = 50;
					hmm2.fitObservations(points, maxIters, false);
					//
					console.log(hmm2.stateTransitionMatrix);
					console.log(hmm2.observationProbabilityCPDs[0].means);
					console.log(hmm2.observationProbabilityCPDs[1].means);
					console.log(hmm2.observationProbabilityCPDs[2].means);
				

Restricted Boltzmann Machine (RBM)

  • Fit with Contrastive-Divergence algorithm
  • demo
  • Based on DNN deep-learning package

Gaussian Mixture Model (GMM)

  • Fit with EM
  • Fit with Gibbs sampling
  • see demo

					var nbstates = 2;
					var obsdim = 3;
					var gmm1 = new GaussianMixtureModel(nbstates, obsdim);
					// simulation
					var pathLength = 200;
					var points = gmm1.simulateStates(pathLength, true).observations;
					// estimation with EM algorithm
					var gmm2 = new GaussianMixtureModel(nbstates, obsdim);
					var maxIters = 50;
					gmm2.fitObservations(points, maxIters, false);
				

					// bayesian estimation with Gibbs sampling
					var observations = (some list of vectors)
					var uncertainty = 1; // variance of bayesian prior of mean
					var maxIters = 50;
					GibbsGMM(nbstates, maxIters, uncertainty, observations);
				

Winner-Take-All clustering


					var observations = (some list of vectors)
					var nbclasses = 2;
					var lambda = 0.01; // learning rate
					var nbepochs = 1000;
					var centers = WinnerTakeAll(observations, nbclasses, lambda, nbepochs);
					console.log(centers[0]);
					console.log(centers[1]);
				

Thompson sampling for A/B testing

  • Also called the multi-arm bandit problem
  • Also called the "exploit vs explore" problem
  • see demo

Entropy