运行结果如下:假设100万的房子
在通涨2%,房价增长2%(即0增长),如果首付30万,贷款15年,贷款利率6%,而相同房子的租金是3000的情况下,如果把首付以及月供和房租的差价都用来投资,那么在15年以后,为了能够买下相同的房子,你投资的年回报需要达到4.61%。

假设房价只增长1%(即折旧>通涨),那么投资的年回报仍旧需要3.26%。如果不增长(即买了只能折旧),那么投资的回报只要1.87%。

假设房价增长和通涨一样,但是贷款期限变成30年,那么30年后为了买下相同的房子,年回报要4%。即使租金从3000变成2000,那么年回报还是需要2.53%。

所以,买房子只要不是买在高位,只要贷款利率不是很高,买房就永远是普通百姓最好的投资方式。

其实有一点很重要就是月供的钱是投资,花在房子上了;但是房租的钱就是消费,花出去就没有了。

把程序也贴一下:matlab

function annual_yield=mortgage(r_inflation,r_realestate,r_mortgage,years,total,downpay,rent)
% calculate the average annual return required to buy a house with downpay
% invested instead of mortgage with fix rate

% simple model: no tax, all rates are fixed, all interests are compounded
% monthly, rent inflates yearly

% parameter
% r_inflation = inflation rate
% r_realestate = realestate value growth rate
% if r_realestate = r_inflation, means no growth
% if r_realestate < r_inflation, means only depreciation
% r_mortgage = mortgage rate
% years = mortgage years
% total = present value of the realestate
% downpay = first payment, usually 30% or up
% rent = rent, increase yearly at r_inflation

if r_inflation<0
    r_inflation=0.03;
end
%if r_realestate<r_inflation
%    r_realestate=r_inflation;
%end
if r_mortgage<0
    r_mortgage=r_inflation+0.025;
end
%if years>30
%    years=30;
%end
if downpay<0
    downpay=total*0.3;
end

a=(1+r_mortgage/12)^(12*years); % principle and interest
c_monthly=a*r_mortgage/12/(a-1); % 1/discount factor
pay_monthly=(total-downpay)*c_monthly % monthly payment

if (rent<0 | rent>pay_monthly)
    rent=pay_monthly;
end
invest_monthly=pay_monthly-rent;

annual_rent=rent*12;
total_rent=((1+r_inflation)^years-1)/r_inflation*annual_rent;

total_future=total*(1+r_realestate/12)^(12*years);

i=1;
r_yield=r_realestate+0.0001;
b=(1+r_yield/12)^(12*years);
while ((downpay*b+invest_monthly*12*(b-1)/r_yield)<total_future)
    i=i+1;
    r_yield=r_yield+0.0001;
    b=(1+r_yield/12)^(12*years);
end

annual_yield=r_yield;

廣告