Modeling the roles of oxygen vacancies in thin film ferroelectric memory