Last week, I argued that the odds are good that Brazilian and Chinese stocks will outperform their developed-economy peers over the next year, due to the faster growth rates of those economies.

And I said that the best place to be in those emerging markets was the shares of domestically oriented companies. In other words, you want to buy shares of companies that sell to prospering Brazilian and Chinese consumers, rather than companies that sell for export into the slowing global economy. (See this post here.)

Well, since I don’t have a rich uncle who gives me a paper bag of cash whenever I want to buy a stock, buying domestically oriented companies means selling something else. In Brazil, right now, I think that means selling shares of Cosan (CZZ in New York and CSAN3.BZ in Sao Paulo).

In the short term, sugar production in Brazil is down. Output in the first two weeks of August in Brazil’s Center South region, the world’s biggest producing region, fell by 3.4% from the same period last year. The harvest, which stretches from March through November, is on track to be 10% or more smaller than last year.

In the short term, the price of ethanol made from sugar faces downward pressure from lower global oil prices. Ethanol competes with gasoline as a fuel in Brazil, so lower gas prices convince some consumers to switch.

Smaller production, lower global demand, and pricing pressures don’t bode well, in the short term, for Cosan and its huge Raizen joint venture with Royal Dutch Shell (RDS).

In the long term, however, the tough times for sugar and ethanol producers will help Raizen expand its share of the markets. Although the joint venture is now predicting that its mills will crush just 53 to 56 million metric tons in the 2011/2012 sugar year, well below the venture’s 65 million-ton capacity, Raizen is talking expansion.

The joint venture, already the largest sugar producer with 10% of the market, plans to invest $7 billion to expand its crushing capacity to 100 million metric tons. At the same time, the joint venture is talking about a substantial increase in its spending on renewing sugar cane plantations.

Sugar cane plantings take about 18 months to reach maturity, and then start to show declining production after five or six years. The 2008 recession slowed investment in Brazil in new sugar cane plantings; consequently, production has started to slip.

Why all this talk of investment when the short-term picture isn’t so sweet? Because Cosan and Royal Dutch realize that in a fragmented industry dominated by lots of smaller and weakly capitalized producers, their financial muscle is a huge advantage. And they are determined to put it to work through Raizen.

I think that means that Cosan will be a great investment in two years or so, when this strategy starts to bear fruit.

In the meantime, I would sell my shares in Cosan and put the proceeds to work in domestically oriented Brazilian companies. I’ll have some names to suggest in the next few days.

I’m selling Cosan out of Jubak’s Picks with a loss of 14.5% since I added it to that portfolio on November 12, 2010.

Full disclosure: I don’t own shares of any of the companies mentioned in this post in my personal portfolio. The mutual fund I manage, Jubak Global Equity Fund, may or may not now own positions in any stock mentioned in this post. The fund did own shares in Cosan as of the end of June. For a full list of the stocks in the fund as of the end of June, see the fund’s portfolio here.