Incorporating theoretical restrictions into forecasting by projection methods