Investigating ecological speciation