A microscopic study of barium titanate