Skip to main content
added 36 characters in body
Source Link
Tim
  • 141.2k
  • 26
  • 270
  • 512

I'm afraid you got several things wrong.

  • If I understand correctly, you are fitting a mixture of Gaussians to your data. The mixture will approximate the distribution of your data. It won't necessarily perfectly fit the empirical distribution, because it is just an approximation of the distribution.

  • This part is also incorrect

    In my understanding, as the density graph can be assumed as $$g(x) = \sum_{i=1}^n f_i(x)$$

    Mixture distribution is defined as

    $$ g(x) = \sum_{i=1}^n \pi_i \, f_i(x) $$

    where $\pi_i$ are the mixing proportions such that $\sum_i \pi_i = 1$ and $\forall \pi_i \ge 0$.

  • As for your "jiggely" plot, this is just a plotting artifact. If you used a denser grid to produce the plot, it would be smooth.

  • Answering your last question, you definitely can fix the means of the mixture components and estimate only the mixing weights $\pi_i$ and variances $\sigma^2_i$. I'm not sure though if the flexmix library allows for this, you should consult the documentation.

  • Finally, you say that the "maxima are not where they should be", but what you are doing is you are comparing one approximation of the distribution (kernel density) with another approximation of the distribution (Gaussian mixture). Both approximations can give different answers. Either or none of those modes can be the correct estimate. So using the modes from your first approximation to fix them in the second approximation is not guaranteed to give a better answer than sticking to the regular Gaussian mixture where the means are estimated from the data.

I'm afraid you got several things wrong.

  • If I understand correctly, you are fitting a mixture of Gaussians to your data. The mixture will approximate the distribution of your data. It won't necessarily perfectly fit the empirical distribution, because it is just an approximation of the distribution.

  • This part is also incorrect

    In my understanding, as the density graph can be assumed as $$g(x) = \sum_{i=1}^n f_i(x)$$

    Mixture distribution is defined as

    $$ g(x) = \sum_{i=1}^n \pi_i \, f_i(x) $$

    where $\pi_i$ are the mixing proportions such that $\sum_i \pi_i = 1$ and $\forall \pi_i \ge 0$.

  • As for your "jiggely" plot, this is just a plotting artifact. If you used a denser grid to produce the plot, it would be smooth.

  • Answering your last question, you definitely can fix the means of the mixture components and estimate only the mixing weights $\pi_i$ and variances $\sigma^2_i$. I'm not sure though if the flexmix library allows for this, you should consult the documentation.

  • Finally, you say that the "maxima are not where they should be", but what you are doing is you are comparing one approximation of the distribution with another approximation of the distribution. Both approximations can give different answers. Either or none of those modes can be the correct estimate. So using the modes from your first approximation to fix them in the second approximation is not guaranteed to give a better answer than sticking to the regular Gaussian mixture where the means are estimated from the data.

I'm afraid you got several things wrong.

  • If I understand correctly, you are fitting a mixture of Gaussians to your data. The mixture will approximate the distribution of your data. It won't necessarily perfectly fit the empirical distribution, because it is just an approximation of the distribution.

  • This part is also incorrect

    In my understanding, as the density graph can be assumed as $$g(x) = \sum_{i=1}^n f_i(x)$$

    Mixture distribution is defined as

    $$ g(x) = \sum_{i=1}^n \pi_i \, f_i(x) $$

    where $\pi_i$ are the mixing proportions such that $\sum_i \pi_i = 1$ and $\forall \pi_i \ge 0$.

  • As for your "jiggely" plot, this is just a plotting artifact. If you used a denser grid to produce the plot, it would be smooth.

  • Answering your last question, you definitely can fix the means of the mixture components and estimate only the mixing weights $\pi_i$ and variances $\sigma^2_i$. I'm not sure though if the flexmix library allows for this, you should consult the documentation.

  • Finally, you say that the "maxima are not where they should be", but what you are doing is you are comparing one approximation of the distribution (kernel density) with another approximation of the distribution (Gaussian mixture). Both approximations can give different answers. Either or none of those modes can be the correct estimate. So using the modes from your first approximation to fix them in the second approximation is not guaranteed to give a better answer than sticking to the regular Gaussian mixture where the means are estimated from the data.

Source Link
Tim
  • 141.2k
  • 26
  • 270
  • 512

I'm afraid you got several things wrong.

  • If I understand correctly, you are fitting a mixture of Gaussians to your data. The mixture will approximate the distribution of your data. It won't necessarily perfectly fit the empirical distribution, because it is just an approximation of the distribution.

  • This part is also incorrect

    In my understanding, as the density graph can be assumed as $$g(x) = \sum_{i=1}^n f_i(x)$$

    Mixture distribution is defined as

    $$ g(x) = \sum_{i=1}^n \pi_i \, f_i(x) $$

    where $\pi_i$ are the mixing proportions such that $\sum_i \pi_i = 1$ and $\forall \pi_i \ge 0$.

  • As for your "jiggely" plot, this is just a plotting artifact. If you used a denser grid to produce the plot, it would be smooth.

  • Answering your last question, you definitely can fix the means of the mixture components and estimate only the mixing weights $\pi_i$ and variances $\sigma^2_i$. I'm not sure though if the flexmix library allows for this, you should consult the documentation.

  • Finally, you say that the "maxima are not where they should be", but what you are doing is you are comparing one approximation of the distribution with another approximation of the distribution. Both approximations can give different answers. Either or none of those modes can be the correct estimate. So using the modes from your first approximation to fix them in the second approximation is not guaranteed to give a better answer than sticking to the regular Gaussian mixture where the means are estimated from the data.