Portmanteau Tests for Univariate and Multivariate Time Series