A rational theory for disposition effects