Policymakers and investors often conceptualize trend growth as simply a medium/long term average growth rate. In practice, these averages are usually taken over arbitrary periods of time, thereby ignoring the large empirical growth literature which shows that doing so is inappropriate, especially in developing countries where growth is highly unstable. This paper builds on this literature to propose an algorithm, called "iterative Fit and Filter" (iFF), that extracts the trend as a sequence of medium/long term growth averages. iFF separates important countryspecific historical episodes and trend growth durations - number of years between two consecutive trend growth shifts, vary substantially across countries and over time. We relate the conditional probabilities of up and down-shifts in trend growth next year to the country's current growth environment, level of development, demographics, institutions, economic management and external shocks, and show how both iFF and the predictive model could be employed in practice.