CS359 Linear models and optimization