Quantum theory from Hamilton's Principle with imperfect information