Modeling and inferring in science