section_path: Extinction of major groups/Pre-extinction diversity
section_name: Pre-extinction diversity
paragraph_text: Pre-extinction diversity
  
  Just before the K-Pg extinction event, the number of non-avian dinosaur species that existed globally has been estimated at between 628 and 1078. It remains uncertain whether the diversity of dinosaurs was in gradual decline before the K-Pg extinction event, or whether dinosaurs were actually thriving prior to the extinction. Rock formations from the Maastrichtian epoch, which directly preceded the extinction, have been found to have lower diversity than the preceding Campanian epoch, which led to the prevailing view of a long-term decline in diversity. However, these comparisons did not account either for varying preservation potential between rock units or for different extents of exploration and excavation. In 1984, Dale Russell carried out an analysis to account for these biases, and found no evidence of a decline; another analysis by David Fastovsky and colleagues in 2004 even showed that dinosaur diversity continually increased until the extinction, but this analysis has been rebutted. Since then, different approaches based on statistics and mathematical models have variously supported either a sudden extinction or a gradual decline. End-Cretaceous trends in diversity may have varied between dinosaur lineages: it has been suggested that sauropods were not in decline, while ornithischians and theropods were in decline.