Section 6: Prophet for Business Forecasting
Learning Objectives
By the end of this section, students will be able to:
- Understand Prophet’s capabilities for real estate forecasting
- Build Prophet models for property market analysis
- Handle holidays and special events in real estate data
- Use Prophet’s automatic seasonality detection
- Generate business-ready forecasts with uncertainty intervals
Introduction
Prophet is a powerful forecasting tool designed for business applications. This section teaches how to use Prophet for real estate market forecasting, including handling seasonality, trends, and special events.
Main Content
Prophet Model Components
Trend Component: - Piecewise linear or logistic growth - Automatic changepoint detection - Trend flexibility parameters - Handles market regime changes
Seasonality Component: - Daily, weekly, and yearly patterns - Fourier series for complex seasonality - Automatic seasonality detection - Custom seasonality modes
Holiday Component: - Built-in holiday calendars - Custom holiday definitions - Holiday effect modeling - Special event handling
Error Term: - Additive or multiplicative errors - Robust to outliers - Missing data handling - Irregular patterns
Real Estate Applications
Property Price Forecasting: - Monthly price index predictions - Quarterly market analysis - Annual trend projections - Long-term market outlook
Rental Market Analysis: - Seasonal rent patterns - Market cycle identification - Vacancy rate forecasting - Rent growth predictions
Market Timing: - Buy/sell timing signals - Market peak/valley detection - Investment opportunity identification - Risk assessment
Example: Residential Market Forecasting with Prophet
Building a comprehensive Prophet model for residential property price forecasting.
Model Setup:
from prophet import Prophet
import pandas as pd
# Load data
df = pd.read_csv('residential_prices.csv')
df['ds'] = pd.to_datetime(df['date'])
df['y'] = df['price_index']
df = df[['ds', 'y']]
# Initialize Prophet model
model = Prophet(
yearly_seasonality=True,
weekly_seasonality=False,
daily_seasonality=False,
seasonality_mode='multiplicative',
changepoint_prior_scale=0.05,
seasonality_prior_scale=10.0
)
# Add custom seasonality
model.add_seasonality(name='quarterly', period=91.25, fourier_order=8)
# Add holidays
model.add_country_holidays(country_name='US')
# Fit model
model.fit(df)Forecasting:
# Create future dataframe
future = model.make_future_dataframe(periods=24, freq='M')
# Generate forecasts
forecast = model.predict(future)
# Plot results
fig = model.plot(forecast)
plt.title('Residential Price Index Forecast')
plt.show()
# Plot components
fig = model.plot_components(forecast)
plt.show()Model Diagnostics:
# Cross-validation
from prophet.diagnostics import cross_validation, performance_metrics
# Perform cross-validation
df_cv = cross_validation(model, initial='730 days', period='90 days', horizon='180 days')
# Calculate performance metrics
df_performance = performance_metrics(df_cv)
print(df_performance)
# Plot cross-validation results
from prophet.plot import plot_cross_validation_metric
plot_cross_validation_metric(df_cv, metric='mape')Key Insights: - Strong yearly seasonality (spring peak) - Quarterly patterns visible - Trend changepoints in 2008 and 2020 - Holiday effects on transaction volume
Practice Exercise
Build a Prophet model for commercial property rents:
- Prepare data with appropriate frequency
- Configure seasonality and trend parameters
- Add relevant holidays and events
- Generate forecasts with uncertainty intervals
Assets
- Prophet implementation guides
- Seasonality analysis tools
- Holiday calendar templates
Summary
Prophet provides an intuitive and powerful framework for real estate business forecasting. Its automatic seasonality detection and holiday handling make it ideal for property market analysis.
Next Steps
The next section covers scenario planning and Monte Carlo simulation for real estate forecasting.
© 2025 Prof. Tim Frenzel. All rights reserved. | Version 1.0.5