Productivity shocks, non-traded goods and optimal capital accumulation