Linear analysis of degree correlations in complex networks