A Matrix approach to nonstationary chains