SPB Git forge

spb/wp4_uqo

Public
3commits 1branches 1releases
5.4 MBsize
maindefault branch
4 h agolast push
Python 64.6% TeX 23.3% HTML 11.6% Makefile 0.5%
9.8 KB · 257 lines latex
Raw Blame History
1% ==========================================================================2\section{Methodology}3\label{sec:methodology}4% ==========================================================================56\subsection{Hedonic Pricing Framework}78Following \citet{Rosen1974}, we model the nightly listing price as a9function of the listing's observable characteristics. Let $p_i$ denote the10nightly price of listing $i$ and let $\mathbf{x}_i$ denote the vector of11$K$ characteristics. The hedonic price function is:12\begin{equation}13p_i = P(\mathbf{x}_i) + \eps_i,14\label{eq:hedonic_general}15\end{equation}16where $P(\cdot)$ maps the characteristic space into prices and17$\eps_i$ is an idiosyncratic error term.1819We adopt a log-linear specification:20\begin{equation}21\ln p_i = \alpha + \boldsymbol{\beta}' \mathbf{x}_i + \eps_i,22\label{eq:loglinear}23\end{equation}24where $\alpha$ is a constant, $\boldsymbol{\beta}$ is the $K \times 1$25vector of hedonic coefficients, and $\eps_i \sim (0, \sigma^2_i)$ is26mean-zero but potentially heteroskedastic. The log transformation27accommodates the right-skewed price distribution, yields coefficients28interpretable as approximate percentage changes, and imposes a29multiplicative structure consistent with proportional interactions among30characteristics.3132\subsection{Model Specification}3334The full hedonic equation expands the characteristic vector into seven35attribute blocks:36\begin{equation}37\begin{aligned}38\ln p_i = \; & \alpha39  + \boldsymbol{\beta}_S' \, \mathbf{S}_i40  + \boldsymbol{\beta}_A' \, \mathbf{A}_i41  + \boldsymbol{\beta}_H' \, \mathbf{H}_i42  + \boldsymbol{\beta}_R' \, \mathbf{R}_i \\43  & + \boldsymbol{\beta}_L' \, \mathbf{L}_i44  + \boldsymbol{\beta}_N' \, \mathbf{N}_i45  + \boldsymbol{\beta}_C' \, \mathbf{C}_i46  + \eps_i,47\end{aligned}48\label{eq:full_model}49\end{equation}50where $\mathbf{S}_i$ collects structural characteristics,51$\mathbf{A}_i$ contains amenity indices,52$\mathbf{H}_i$ captures host attributes,53$\mathbf{R}_i$ comprises reputation variables,54$\mathbf{L}_i$ includes locational controls,55$\mathbf{N}_i$ represents text-derived features, and56$\mathbf{C}_i$ denotes spatial context controls.5758\subsection{Feature Engineering}5960\textit{Structural features.} We include linear terms for bedrooms,61bathrooms, and guest capacity, plus log-transformed counterparts62($\log(1 + x)$). Per-guest ratios address the proportionality of space63to capacity. Quadratic terms (accommodates$^2$, bedrooms$^2$,64bathrooms$^2$) and interactions (accommodates $\times$ bedrooms,65accommodates $\times$ bathrooms) capture non-linear and joint effects.6667\textit{Amenity features.} Six expert-weighted composite indices are68constructed from 24 tracked amenity categories, with weights reflecting69assumed market value (e.g., pool receives weight 2.0 in the luxury index;70Wi-Fi receives weight 3.0 in the remote work index). All indices are71normalized to $[0, 1]$.7273\textit{Host features.} Superhost status enters as a binary indicator. A74multi-listing host indicator proxies for professionalization. An interaction75term (Superhost $\times$ entire-home) tests whether the Superhost premium76differs by listing type.7778\textit{Reputation features.} The overall review score (0--5) enters79linearly. The number of reviews enters in log form. A composite reputation80score combines normalized rating and review volume:81\begin{equation}82\text{reputation}_i = 0.6 \times \frac{\text{rating}_i}{5}83  + 0.4 \times \frac{\log(1 + \text{reviews}_i)}84                     {\max_j \log(1 + \text{reviews}_j)}.85\label{eq:reputation}86\end{equation}8788\textit{Locational features.} Distance to the nearest city centre is89computed using the Haversine formula:90\begin{equation}91d_{ij} = 2R \arcsin\!\left(92  \sqrt{\sin^2\!\left(\frac{\Delta\phi}{2}\right)93  + \cos\phi_i \cos\phi_j \sin^2\!\left(\frac{\Delta\lambda}{2}\right)}94\right),95\label{eq:haversine}96\end{equation}97where $R = 6{,}371$~km. Reference coordinates are provided for 2298Quebec municipalities.99100\textit{Spatial context features.} Using a BallTree with haversine metric,101we compute local listing density within 500m and 1~km, local average price102within 500m and 1~km, and a $K$-means spatial cluster ($K = 20$).103104\textit{Text features.} From listing names and descriptions, we extract105title length, seven bilingual keyword scores, and 10 TF-IDF/SVD components106(sublinear term frequency, up to 5,000 features, unigrams and bigrams,107dimensionality reduced via Truncated SVD capturing 16.98\% of variance).108109\subsection{OLS Estimation with Robust Inference}110111We estimate Equation~\eqref{eq:full_model} by OLS with112heteroskedasticity-robust standard errors using the HC3 estimator:113\begin{equation}114\widehat{\Var}(\hat{\boldsymbol{\beta}})_{\text{HC3}}115= (\mathbf{X}'\mathbf{X})^{-1}116  \left( \sum_{i=1}^{N} \frac{\hat{u}_i^2}{(1 - h_{ii})^2}117         \mathbf{x}_i \mathbf{x}_i' \right)118  (\mathbf{X}'\mathbf{X})^{-1},119\label{eq:hc3}120\end{equation}121where $h_{ii}$ is the $i$th diagonal element of the hat matrix122$\mathbf{H} = \mathbf{X}(\mathbf{X}'\mathbf{X})^{-1}\mathbf{X}'$.123124\subsection{Nested Model Strategy}125126To assess the marginal explanatory power of each attribute block, we127estimate nine nested models:128%129\begin{enumerate}[leftmargin=2em]130    \item[M1.] Structural characteristics only.131    \item[M2.] M1 + amenity bundle.132    \item[M3.] M2 + host attributes.133    \item[M4.] M3 + reputation and reviews.134    \item[M5.] M4 + locational controls.135    \item[M6.] M5 + neighbourhood (spatial cluster).136    \item[M7.] M6 + text-derived features.137    \item[M8.] M7 + spatial context controls.138    \item[M9.] Full hedonic model (identical to M8).139\end{enumerate}140%141We compare models using $R^2$, adjusted $R^2$, AIC, BIC, RMSE, and MAE.142143\subsection{Quantile Regression}144145To explore heterogeneity across the price distribution, we estimate146quantile regressions \citep{KoenkerBassett1978} at147$\tau \in \{0.10, 0.25, 0.50, 0.75, 0.90\}$:148\begin{equation}149Q_\tau(\ln p_i \mid \mathbf{x}_i)150= \alpha_\tau + \boldsymbol{\beta}_\tau' \, \mathbf{x}_i,151\label{eq:quantile}152\end{equation}153solved by minimizing the asymmetric check function:154\begin{equation}155\min_{\alpha_\tau, \boldsymbol{\beta}_\tau}156\sum_{i=1}^{N} \rho_\tau\!\left(\ln p_i - \alpha_\tau157  - \boldsymbol{\beta}_\tau' \mathbf{x}_i \right),158\quad159\rho_\tau(u) = u \left(\tau - \mathbf{1}(u < 0)\right).160\label{eq:check_function}161\end{equation}162Model fit is assessed via the Koenker--Bassett pseudo-$R^2$:163\begin{equation}164\text{pseudo-}R^2_\tau = 1165  - \frac{\sum_i \rho_\tau(\hat{u}_i)}166         {\sum_i \rho_\tau(\ln p_i - \hat{Q}_\tau^{(0)})}.167\label{eq:pseudoR2}168\end{equation}169170\subsection{Machine Learning Models}171172We complement the econometric analysis with seven supervised learning173algorithms trained on the same feature set using an 80/20 train/test174split ($N_{\text{train}} = 1{,}524$, $N_{\text{test}} = 382$):175ElasticNet \citep{ZouHastie2005}, Random Forest ($B = 500$ trees)176\citep{Breiman2001}, Gradient Boosting (500 trees, learning rate 0.05)177\citep{Friedman2001}, XGBoost (500 estimators, depth 6)178\citep{ChenGuestrin2016}, LightGBM (500 estimators, 31 leaves),179CatBoost (500 iterations, depth 6), and a Generalized Additive Model.180Predictive performance is evaluated using $R^2$, RMSE, MAE, and MAPE.181182\subsection{SHAP Interpretability}183184To reconcile predictive power with interpretability, we employ185SHAP \citep{Lundberg2017}. For each prediction $\hat{f}(\mathbf{x}_i)$,186SHAP decomposes the deviation from the baseline into additive feature187contributions:188\begin{equation}189\hat{f}(\mathbf{x}_i) = \phi_0190  + \sum_{k=1}^{K} \phi_k(\mathbf{x}_i),191\label{eq:shap}192\end{equation}193where $\phi_0 = \E[\hat{f}]$ and $\phi_k(\mathbf{x}_i)$ is the SHAP194value of feature $k$ for observation $i$. The mean absolute SHAP value195$\overline{|\phi_k|}$ provides a global importance ranking.196197\subsection{Spatial Econometric Models}198199We construct a row-standardized $k$-nearest-neighbours weight matrix200$\mathbf{W}$ with $k = 5$ and estimate three spatial models201\citep{LeSagePace2009, Anselin1988}:202203\textit{Spatial Lag Model (SLM):}204\begin{equation}205\ln \mathbf{p} = \rho \, \mathbf{W} \ln \mathbf{p}206  + \mathbf{X} \boldsymbol{\beta} + \boldsymbol{\eps},207\label{eq:slm}208\end{equation}209where $\rho$ captures endogenous spatial interaction.210211\textit{Spatial Error Model (SEM):}212\begin{equation}213\ln \mathbf{p} = \mathbf{X} \boldsymbol{\beta} + \mathbf{u}, \quad214\mathbf{u} = \lambda \, \mathbf{W} \mathbf{u}215  + \boldsymbol{\eps},216\label{eq:sem}217\end{equation}218where $\lambda$ captures spatial autocorrelation in the errors.219220\textit{Spatial Durbin Model (SDM):}221\begin{equation}222\ln \mathbf{p} = \rho \, \mathbf{W} \ln \mathbf{p}223  + \mathbf{X} \boldsymbol{\beta}224  + \mathbf{W} \mathbf{X} \boldsymbol{\theta}225  + \boldsymbol{\eps},226\label{eq:sdm}227\end{equation}228which nests both SLM and SEM under parameter restrictions and allows229neighbours' characteristics to exert direct spillover effects.230231Spatial dependence is tested using Moran's $I$ on the OLS residuals:232\begin{equation}233I = \frac{N}{\sum_{i}\sum_{j} w_{ij}}234    \frac{\sum_{i}\sum_{j} w_{ij}235          (\hat{u}_i - \bar{\hat{u}})(\hat{u}_j - \bar{\hat{u}})}236         {\sum_{i} (\hat{u}_i - \bar{\hat{u}})^2}.237\label{eq:moranI}238\end{equation}239240\subsection{Price Decomposition}241242For listing $i$, the predicted log-price decomposes as:243\begin{equation}244\widehat{\ln p_i}245= \hat{\alpha}246  + \underbrace{\hat{\boldsymbol{\beta}}_S' \mathbf{S}_i}_{\text{property}}247  + \underbrace{\hat{\boldsymbol{\beta}}_A' \mathbf{A}_i}_{\text{amenity}}248  + \underbrace{\hat{\boldsymbol{\beta}}_H' \mathbf{H}_i}_{\text{host}}249  + \underbrace{\hat{\boldsymbol{\beta}}_R' \mathbf{R}_i}_{\text{review}}250  + \underbrace{\hat{\boldsymbol{\beta}}_L' \mathbf{L}_i}_{\text{location}}251  + \underbrace{\hat{\boldsymbol{\beta}}_N' \mathbf{N}_i}_{\text{text}}252  + \underbrace{\hat{\boldsymbol{\beta}}_C' \mathbf{C}_i}_{\text{spatial}}.253\label{eq:decomposition}254\end{equation}255This decomposition provides hosts with a transparent breakdown of how the256market values each attribute of their listing.257