Using software (e.g. R or sklearn in python) get the regression coefficients for the regression of car price on mileage and year with an intercept.
We used this data in our quick looks at R and python:
http://www.rob-mcculloch.org/R/R_Hello-World_Regression.html
http://www.rob-mcculloch.org/python/Py_Hello-Word_Regression.html
Reproduce these coefficient using the Cholesky and Singular value decompositions.
In the simulated example for a three component univarate normal mixtures we used \[ \mu = (0,1,5), \;\; \sigma = (1, .5, 2), \;\; p = (.4,.4,.2) \]
Letting \(I\) be the random variable denoting the mixture component of \(Y\), plot \[ P(I=j \,|\, y,\mu,\sigma,p) \] versus \(y\) for \(j=1,2,3\).
Code up the simple EM algorithm for univariate normal mixtures.
See you if you can reproduce the results for the galaxies data.
library(MASS)
summary(galaxies)
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 9172 19532 20834 20828 23133 34279
For non-R folks, I put the galaxies data on my data webpage:
temp = read.csv("http://www.rob-mcculloch.org/data/galaxies.csv")
summary(temp - galaxies)
## x
## Min. :0
## 1st Qu.:0
## Median :0
## Mean :0
## 3rd Qu.:0
## Max. :0