A Model to Predict COVID-19 Epidemics with Applications to South Korea, Italy, and Spain