The method of moments for linear random initial value problems