confidence vs optimism

confidence

noun
  • Self-assurance. 

  • A feeling of certainty; firm trust or belief; faith. 

  • Information held in secret; a piece of information shared but to thence be kept in secret. 

optimism

noun
  • a tendency to expect the best, or at least, a favourable outcome 

  • the doctrine that this world is the best of all possible worlds 

  • the belief that good will eventually triumph over evil 

How often have the words confidence and optimism occurred in a corpus of books? (source: Google Ngram Viewer )