租金 預測
by Zhen Liu
劉震
如何預測租金并優化租賃期限,從而節省資金 (How to Predict Rent and Optimize Your Lease Duration So You Can Save Money)
In my last post, we talked about how to pick the best month to sign the lease based on seasonality. Now, how long should you sign the lease for when facing different options like 12-month, 15-month, 18-month or longer? Is there any strategy in selecting the best option to save money?
在我的上一篇文章中 ,我們討論了如何根據季節選擇最佳月份來簽署租約。 現在,當面對不同的選擇(例如12個月,15個月,18個月或更長時間)時,您應該簽署多長時間的租約? 選擇省錢的最佳選擇是否有任何策略?
To analyze this, I modelled 353 cities’ rent data from Zillow (one-bedroom, city-level data). In this article, I will show you how to make time series predictions, and which cities are predicted to increase the most in rent!
為了對此進行分析,我從Zillow建模了353個城市的租金數據(一居室,城市級別的數據)。 在本文中,我將向您展示如何進行時間序列預測,以及預測哪些城市的租金漲幅最大!
首先,租賃期限如何幫助您節省資金? (First, how does lease duration help you save money?)
As shown below, you can save money by signing a longer lease if you predict the rent will increase in your city. If the monthly rent increases $100 in the next year, you’ll save $1,200 by signing a 2-year lease, then renew it year-by-year.
如下圖所示,如果您預計城市租金會上漲,則可以通過簽一份更長的租約來省錢。 如果明年的月租金增加100美元,則您可以通過簽訂2年的租約,然后逐年續約來節省1200美元。
您如何預測租金會增加嗎? (How do you predict if rent will increase?)
We observed that rent is an additive time series with a combination of seasonality, trend and some random noise.
我們觀察到,租金是具有季節性,趨勢和一些隨機噪聲的組合的附加時間序列。
Additive model: Y(t) =Seasonality(t) + Trend(t) + Randomness(t)
加性模型:Y(t)=季節性(t)+趨勢(t)+隨機性(t)
We can decompose a time series into the right hand side of the equation above by applying R’s stl()
function (stl stands for "seasonal and trend decomposition using locally weighted scatterplot smoothing”).
我們可以通過應用R的stl()
函數將時間序列分解為上述方程式的右側(stl代表“使用局部加權散點圖平滑的季節和趨勢分解”)。
# Decompose the additive time seriesdecomposed_rent <- stl(rent.series, s.window="periodic") #periodic means the seasonality factor is same for every year
# Extract the components from time seriesseasonal <- decomposed_rent$time.series[,1]trend <- decomposed_rent$time.series[,2]random <- decomposed_rent$time.series[,3]
You can simply apply the st()
function in R on the time series format of rent data to predict rent in the next 2 years.
您可以在租金數據的時間序列格式中簡單地在R中應用st()
函數來預測未來2年的租金。
# Forecast rent for the next 24 months with 95% Confidence Intervalfore_rent<-stlf(rent.series, s.window="period",h=24, level = 95)
預計哪些城市租金上漲? (Which cities have the predicted increase of rent?)
*How to read the plots: The light green band area after 2018 is the 95% Confidence Interval of the rent prediction. The text in purple tells you how much you can save if you sign a 2-year rent vs 1-year rent, according to the purple rectangular area outlined. I used ggplot2
for all the plots.
*如何閱讀地塊:2018年后的淺綠 色帶區域是租金預測的95%置信區間。 根據概述的紫色矩形區域,紫色文本告訴您如果簽定2年租金與1年租金,您可以節省多少。 我將 ggplot2
用于所有繪圖。
1.海灣地區 (1. Bay Area)
Sunnyvale’s predicted monthly rent increase is the greatest among all 246 cities I analyzed, which is $165 (comparing 2018–01’s rent to the predicted rent in 2019–01). So signing a 2-year lease in 2018 Jan can save you 165*12= $ 1980 on the second year; signing a 18-month lease can save 165*6 = $990. Given the seasonality effect in Sunnyvale, you should also try to avoid renewing the lease around July.
在我分析的所有246個城市中,森尼韋爾的預計每月租金漲幅最大,為165美元(將2018-01年度的租金與2019-01年度的預計租金進行比較)。 因此,在2018年1月簽訂為期2年的租賃,第二年可為您節省165 * 12 = $ 1980 ; 簽訂18個月的租約可節省165 * 6 = 990美元 。 考慮到森尼韋爾的季節性影響,您還應盡量避免在7月前后續訂租約。
2,丹佛 (2.Denver)
3,南加州 (3.Southern California)
4.西雅圖地區 (4. Seattle Area)
5.佛羅里達 (5. Florida)
6.德州 (6. Texas)
For the 11 cities above, if a 2-year lease isn’t an option, 18-months can still save a lot compared to an yearly updated increasing rent.
對于上述11個城市,如果不選擇2年租約,則與每年更新的租金增長相比,18個月仍可以節省很多錢。
Which other cities show a huge leap in rent? I plotted the 20 cities total (including the cities mentioned above) to show you a comparison of rent as well as the increase of rent among more cities.
還有哪些城市在租金上有巨大飛躍? 我繪制了20個城市(包括上述城市)的總數,以向您顯示租金的比較以及更多城市之間的租金增長。
The length of line segment of each city is the increase of the rent where the red dot is the rent in 2018–01 and the green is the predicted rent in 2019 -01.
每個城市線段的長度是租金的增加量,其中紅點是2018-01的租金,綠色是2019-01的預計租金。
From the plot above, Lakewood (Denver Metro in CO) and El Cajon (San Diego Metro in CA)’s rents are not that high among the 20 cities, but the “step” of increase is bigger compared to other cities with similar range of rent.
從上圖可以看出,在20個城市中,萊克伍德(科羅拉多州的丹佛地鐵)和埃爾卡洪(加利福尼亞州的圣地亞哥地鐵)的租金并不高,但漲幅的“步伐”比其他類似范圍的城市大租金。
The cities with rent >$2000 and significant predicted increase are all in CA (Top 4 of the plot). The rent there is already expensive, and they are getting more expensive, faster.
租金超過$ 2000美元且預計大幅增長的城市都在CA(地塊的前4位)。 那里的租金已經很昂貴了,而且變得越來越昂貴,越來越快。
Among the top 20, there are 8 in CA, 6 in FL, 2 in WA, 2 in TX, 1 in NY and 1 in CO.
在前20名中,CA排名第8位,FL排名第6位,WA排名第2位,TX排名第2位,NY排名第1位,CO排名第1位。
有沒有哪個城市的租金趨勢不大? (Are there any cities that don’t show much trend in rent?)
For the cities above, there’s no predicted increase. So for cities with very significant seasonality effect like Boston and Wilmington, it doesn’t really matter how long you sign the lease; but which month you sign.
對于以上城市,沒有預計的增長。 因此,對于像波士頓和威爾明頓這樣的季節性影響非常大的城市,簽下租約多長時間并不重要。 但您簽署的月份 。
The month with the highest rent in Boston is November, while it’s April in Wilmington.
波士頓租金最高的月份是11月,威爾明頓的月份是4月。
If you are curious about what are other cities like this, read more about cities with seasonality in my last post!
如果您對這樣的其他城市感到好奇,請在我的上一篇文章中閱讀有關季節性城市的更多信息 !
Find the R code for time series models and visualization with ggplot2 here.
在此處找到用于ggplot2的時間序列模型和可視化的R代碼。
Give me a few claps and follow me here if you find it helpful!
給我一些鼓掌 如果對您有用,請在這里關注我!
翻譯自: https://www.freecodecamp.org/news/https-medium-freecodecamp-org-how-to-predict-rent-and-select-the-best-lease-duration-to-save-money-5cf35145d398/
租金 預測