The paper proposes a way to naturalise Charles S. Peirce's conception of the scientific method, which he specified in terms of abduction, deduction and induction. The focus is on the central issue of the economy of research in abduction and self-correction by error reduction in induction. We show how Peirce's logic of science receives support from modern breakthroughs in computational neuroscience, and more specifically from Karl Friston's statements of active inference and the Free Energy Principle, namely the account of how organisms' capacity to decrease the discrepancy between the expected value and actual outcomes entails the minimisation of errors in their hypotheses about the world. A scientific account of organisms' capacity to choose policies and form expectations is aligned with Peirce's theories of abduction and induction, and especially with the economy of research. The upshot is the recovery of Peirce's theory of the logic of science in the context of active inquiry.