Macromodeling of general linear systems under stochastic variations