Skip to content

dy/gaussian-fit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gaussian-fit unstable

Fit time/spectrum/other sequential data with a set of gaussians by expectation-maximization algoritm.

gaussian-fit

Usage

npm install gaussian-fit

const fit = require('gaussian-fit')

// time/frequency/etc series
let data = [0, .1, .2, .5, .2, .1, 0]

let how = {
	// predefined components, each one is object {weight, mean, variance}
	// TODO if null - the components will be detected automatically
	components: null,

	// TODO max number of components in case of auto-detection
	maxNumber: 100,

	// max number of iterations
	maxIterations: 200,

	// TODO min difference of likelihood
	tolerance: 1e-5,
}

let components = fit(data, how)

components.forEach({weight, mean, variance} => {
	// every component is an object with weight, mean and variance properties
})

Similar

About

Fit mixture of gaussians into data

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages