Expanded alternating optimization for matrix factorization and penalized regression