ComenzarEmpieza gratis

Estimation given the probabilities

Parameters estimation for mixture models is not an easy task. But if you are provided with the probabilities of belonging to each cluster, the estimation of the means and the proportions of the clusters is not so difficult.

In this exercise, you will use a dataset created by two Gaussian distributions called gaussian_sample_with_probs, which in its original form only has the column x, but here you are also provided with the probabilities for each cluster (prob_cluster1 and prob_cluster2). The aim is to estimate the parameters and then visualize the estimated mixture.

Este ejercicio forma parte del curso

Mixture Models in R

Ver curso

Ejercicio interactivo práctico

Prueba este ejercicio completando el código de muestra.

# Estimation of the means
___ <- ___ %>% 
  summarise(mean_cluster1= sum(___*prob_cluster1)/sum(prob_cluster1),
            mean_cluster2 = sum(x*___)/sum(___))
means_estimates

# Estimation of the proportions
props_estimates <- ___ %>% 
  summarise(props_cluster1 = ___(prob_cluster1),
            props_cluster2 = 1 - ___)
props_estimates
Editar y ejecutar código