Question: Assume I have a set of weighted samples, where each samples has a corresponding weight between 0 and 1. I'd like to estimate the parameters of a gaussian mixture distribution that is biased towards the samples with higher weight. In the usual non-weighted case gaussian mixture estimation is done via the EM algorithm.

Is there an implementation (any language is OK) that permits passing weights? If not, how can I modify the algorithm to account for the weights? If not, how to incorporate the weights in the initial formula of the maximum-log-likelihood formulation of the problem?

Answer: 
I've just had the same problem. Even though the post is older, it might be interesting to someone else. honk's answer is in principle correct, it's just not immediate to see how it affects the implementation of the algorithm. From the Wikipedia article for [Expectation Maximization](http://en.wikipedia.org/wiki/Expectation-maximization_algorithm) and a very nice [Tutorial](http://www.ee.washington.edu/techsite/papers/documents/UWEETR-2010-0002.pdf), the changes can be derived easily. 

If $v\_i$ is the weight of the i-th sample, the algorithm from the tutorial (see end of Section 6.2.) changes so that the $gamma\_{ij}$ is multiplied by that weighting factor. 
For the calculation of the new weights $w\_j$, $n\_j$ has to be divided by the sum of the weights $\sum\_{i=1}^{n} v\_i$ instead of just n. That's it...
I think this analysis can be possibly be done via the `pomegranate` (see [Pomegranate](https://pomegranate.readthedocs.io/en/latest/) docs page) that supports a weighted Gaussian Mixture Modeling.

According to their doc:

> 
> weights : array-like, shape (n\_samples,), optional
> The initial weights of each sample in the matrix. If nothing is
> passed in then each sample is assumed to be the same weight.
> Default is None.
> 
> 
> 

Here is a Python snippet I wrote that can possibly help you do a weighted GMM:

```python
from pomegranate import *
import numpy as np

# Generate some data
N = 200
X_vals= np.random.normal(-17, 0.9, N).reshape(-1,1) # Needs to be in Nx1 shape
X_weights = w_function(X_vals) # Needs to be in 1xN shape or alternatively just feed in the weight data you have

pmg_model = GeneralMixtureModel.from_samples([NormalDistribution], 2, X_vals, weights=X_weights.T[0])

```

[[Figure] Observed versus weighted distribution of the data we are analyzing](https://i.stack.imgur.com/xL87i.png)

[[Figure] GMM of the weighted data](https://i.stack.imgur.com/2hMdf.png)