Exploiting relations among output variables for prediction and forecasting