Selection and evolution in narrative ecosystems. A theoretical framework for narrative prediction