Approximate inference in latent variable models based on dimension-wise quadrature