You are incorrect.
CPI-U includes food and energy costs. It also includes housing costs.
CPI tracks average rental costs instead..
How do you think housing prices should be included in CPI? Spell it out.
What fraction of the public rents, and what fraction owns? Reflect that ratio, and what the underlying markets do. For example, if 1/3 rents and 2/3 own, and rents get cheaper by 10%, but new houses double, have the "housing" part of the index show 1/3 of .9, plus 2/3 of 2.0, or, 1.633 net increase in average cost.
I'm not incorrect...core CPI (the most oft cited measure by the Fed and its cheerleaders in the financial media) specifically excludes food and energy prices
As for how to track housing costs...I'm not a statistician but if the purpose of the CPI is to measure the living costs incurred by the average household...why limit the cost of housing criteria to rental prices? All things being equal, as the cost of buying a house goes up...the rents landlords can charge should go down.